user2991183
user2991183

Reputation: 683

background-size is not working in IE8

By referring to this website:http://css3pie.com/documentation/supported-css3-features/

"background-size (will always use the image's intrinsic size) — this is supported as of PIE 2.0 beta"

Based on the documentation, background-size is now supported in PIE 2.0 beta, however, I'm unclear on how to make it works on IE8.

Before making changes:

.navbar-inverse {
background:url('header_images/menu_bg.png');
background-size: 100% 50px;
}

The codes work fine for IE9 and IE10; but I want it works on IE8 too, so I added two lines:

.navbar-inverse {
background:url('header_images/menu_bg.png');
background-size: 100% 50px;
-pie-background: url('header7/header_images/menu_bg.png') no-repeat 100% 100% / 100% 50px;
behavior: url(header7/pie/PIE.php);

}

The background-size is still not functioning. It there anything wrong with my codes?

Upvotes: 2

Views: 1400

Answers (2)

Varun
Varun

Reputation: 56

IE8 does not support background-size property.

try out this polyfill from github.

Using this should allow you to use background-size property in IE8 without any issues.

Upvotes: 0

susu
susu

Reputation: 21

I ran into a similar issue with CSS3PIE.

I found my fix here

.pie_bg{
  background: url("../images/background.jpg") left top no-repeat; 
  background-size: 100% auto;
  -pie-background: url("../images/background.jpg") left top / 100% auto no-repeat;
}

/* NB Image path must be relative to the html doc, not the css file. Alternatively, it can be an absolute path e.g. url("http://mywebsite.com/images/background.jpg")*/

Upvotes: 2

Related Questions