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

3473 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark 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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by