Search code examples
internet-explorer-6backgroundimage-scaling

ie6 image stretch and scale


I need to be able to stretch a image background to fit the window size now it works in all browsers except for ie6 I have endlesly searched the internet for a solution and tried all things I have found but nothing seems to work in ie6

here is my demo site if you have ie6 you will be able to see my problem I need it too stretch the full width and height with out it distorting the image at all

http://demo.jigsawfinance.com/

any one know a solution that will work I have the img tag etc but still no avail

for those without ie6 here is a capture of the screen veiw

alt text

as you can see I have alot of white space where the image is supposed to expand too


Solution

  • There is a way for CSS 3 to do this but since IE6 does not support it, I think your best bet is to use the img tag.

    e.g.

    <img src="../images/jigsaw_logo.png" style="width: 100%; position: absolute; top: 0; left: 0; z-index: -1;"/>
    

    This will retain the proportion of your image and move it back.

    Also take note that in IE's css, you can specify expressions, so try the one below if you're having trouble with the normal 100% css width:

    width: expression(document.body.clientWidth + 'px');