145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
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
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
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

3422 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 100 and 499 items
  • Referred more than 2000 users
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer moderator says
145 posts
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
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
  • Austria
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
LovelessDesign says

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

by
by
by
by
by
by