Page 1 of 1
Can css stretch a background image?
Posted: Fri Jul 20, 2007 4:33 pm
by jamesmusic
Is it possible to strech a background image so it fills the page, rather than a repeat tile...? Or is there a cunning way around this problem in css?
James
Re: Can css stretch a background image?
Posted: Sat Jul 21, 2007 8:37 pm
by garvinhicking
Hi!
There is no CSS property to stretch a background image. I wonder which graphic you could stretch to fit, which would still look okay? Usually the "key to success" is simple repeating. If you have a real image, and not a pattern, stretching it would really look nasty.
You can use the z-index property and place a <img> element with 100% width containing an image, and use absolute positioning to place it below other elements. But that's really hackish.
Apart from that, you might want to ask thsi question in a HTML/CSS specific forum, since it is little related with Serendipity.
Regards,
Garvin