...

View Full Version : div background image stretch to fit div



rlemon
07-12-2005, 05:23 PM
I have a div tag that holds images (for a image gallery)

After the 'next' button is selected the background image of the div tag is changed to the previous image and a new image is 'faded' overtop of it (give a nice fade effect)

the only problem is, when i set the new background image is does not 'fill' the div tag. instead it is scalled to fit (height, or width depending on the image dimensions)

does anyone know how to set a background image for a div tag and make it stretch to fit?

mark87
07-12-2005, 05:30 PM
You can't stretch a background image unfortunately, the only way would be to have a tiling image and repeat it using the 'repeat' property.

rlemon
07-12-2005, 05:45 PM
Found a solution, just layer an image behind it and update that image :P

an example of what i'm doing can be found here (temporary link, will be taken down eventually)

http://rlemon.com/adam_portfolio/gal.htm

take into consideration i just started this gallery. it's nothing specail right now.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum