Change the size of a background image to fit the DIV element
Posted: Fri Apr 16, 2004 11:31 am
Hi,
I've designed a simple background image to use as a backing for all my chunks of text etc by putting text in a DIV element with a backround image.
I was wondering if, since I will use the image over and over in various sized (though similarly sized) DIV elements there is a way to add some height and width attributes to the image?
The code I'm using at present is:
Even better if the image would dynamically change size onload.
Thanks
I've designed a simple background image to use as a backing for all my chunks of text etc by putting text in a DIV element with a backround image.
I was wondering if, since I will use the image over and over in various sized (though similarly sized) DIV elements there is a way to add some height and width attributes to the image?
The code I'm using at present is:
Code: Select all
<div align=center style="background-image: url(backing.gif); height: 400px; width: 330px;">Thanks