首页 > 有什么办法可以让ie浏览器不支持background-image属性,用其他浏览器可以支持

有什么办法可以让ie浏览器不支持background-image属性,用其他浏览器可以支持

遇到个问题,由于ie不支持background-size属性,用ie专有属性filter可以解决。

.theme-logo{
  -webkit-background: transparent url(../imgs/hpd_003.png) center center no-repeat; 
  -moz-background: transparent url(../imgs/hpd_003.png) center center no-repeat; 
  -o-background: transparent url(../imgs/hpd_003.png) center center no-repeat; background: 
  -moz-transparent:url(../imgs/hpd_003.png) center center no-repeat; 
   width: 132px; 
   height: 40px; 
   background-size: 100%; 
   filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../imgs/hpd_003.png',sizingMethod='scale');
   margin-left: 59px;
}

现在的chrome已不需要-webkit-作为前缀了,加了-webkit- chrome中就显示不出来。
不加-webkit-,ie中有能显示,由于ie用filter实现了图片的显示。导致ie中会有两张图片重叠在一起,请问这个该怎么破。有什么css-hack的方法吗?

写了个demo:http://codepen.io/marklow/pen/aZJJWJ


hack

background: transparent url(../imgs/hpd_003.png) center center no-repeat;
 background: none\0;
*background: none;

判断不同的浏览器加载不同的样式

【热门文章】
【热门文章】