145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Hello,

I know <=IE8 doesn’t support background-size. I need “background-size: cover” on my body for the background image. That’s why I used this filter, which works.

<!--[if lte IE 8]>
    <style type="text/css">
    body {
        -ms-filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.jpg', sizingMethod='scale')";
    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.jpg', sizingMethod='scale');
    height:1100px;
    }
    </style>
    <![endif]-->

As you can see I had to define a height because else <=IE8 stretches the image according to the height of the page. With this height, it works for my notebook window size but it still stretches the image if I have a smaller or larger window.

I want that the background always has the full width and the proportional height. If the page is higher, the backgroundcolor should be used (the other browser do this automatically).

Can you help?

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Is there an easy solution or do I really have to change to a div with an image, especially for IE8 and IE7

3432 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Volunteer moderator says
145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

ok, so there is no way to make it work for the body element.

Should I use the DIVs with the image for all browsers or is it also a possibility to keep the background body tag in the other browsers and display the DIV only for <=IE8?

145 posts
  • Has been part of the Envato Community for over 2 years
  • Located in Austria
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
LovelessDesign says

Ok, I’ve done an extra version for <=IE8. Thank you

1 post
metafalica says

I created background-size-emu pure JS library that adds support of background-size to ie6, ie7, ie8 and ie9 in quirks mode. It’s free and you can find it here: https://github.com/Metafalica/background-size-emu

by
by
by
by
by
by