Hi, I am trying to find out whether, if I use a background image, it's possible to have the image stretch to the resolution of the viewers browser. I have tried using:
background:url(RosesBgd02.jpg) no-repeat center;
with the css but it only centers the image - The image is currently 800x600 so therefore any browser over this has a nasty border around the background picture. I know that I can put a background colour but I would prefer to not have this, and have the image stretch to the edges. Any clues please?
Hiya, unfortunately the css background property doesn't take height/width dimensions so there's no quick fix for this one. The only way i can think of is to set the image within a div tag then change the z-axis so it sits behind your content. I would check browser compatibility though as this is a bit of a cheap hack.
Always better to resize the image in an art package though so you're starting off with the correct proportions.
Cheers
Paul.
__________________ Mediaedge:cia - Marketing's and Campaign's Media Agency Of the Year - 2007
e: paul.wright@mecglobal.com | t: 0207 803 2976 | m: 07834 697 130
I think the only way you could do it would be by using the JavaScript onResize() function.
I have got round it on a site I am designing for a customer by using an <img src="whetever.jpg" width="90%"> tag. This site look similar in all screen sizes from 1600 *1200 to 640 * 480