background-size not working in IE

2019-08-07 03:43发布

I have checked the other post. I am having some problem in using css3 property background-size in IE.

.topBar {
    width:100%;
    background:url(../siteImages/top_bar.png) repeat-x ;
    background-size:auto 43px;
    height:77px;
}

I know about this code for IE.

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
src='images/logo.gif',
sizingMethod='scale');

-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(
src='images/logo.gif',
sizingMethod='scale')";

This will make the size of background to cover the area.

3条回答
何必那么认真
2楼-- · 2019-08-07 04:31

background-size is a CSS3 property which isn't supported on IE8 and below.

You can also try this:

background:url(../siteImages/top_bar.png) 0 0 / auto 43px repeat-x fixed;
查看更多
时光不老,我们不散
3楼-- · 2019-08-07 04:36

try to add vendor

/* Vendor Prefixes used with the Cover Value*/
-webkit-background-size: auto 43px;
-moz-background-size: auto 43px;
-o-background-size: auto 43px;
background-size: auto 43px;

also check this

IE8 fix for background-size property? Retina Image

and this

https://developer.mozilla.org/en-US/docs/Web/CSS/background-size

查看更多
Root(大扎)
4楼-- · 2019-08-07 04:42

background-size is a CSS3 property which isn't supported before IE9.

However, there is a topic which gives possible solution: How do I make background-size work in IE?

查看更多
登录 后发表回答