使用IE的滤镜 filter想兼容background-size:cover,但在IE8中还是没有兼容?
图片并没有全屏显示,是否是filter不支持相对路径
.error_body{
height: 100%;
background-image:url(../images/404.png);
background-size: cover;
background-position: center;
background-attachment:fixed;
background-repeat:no-repeat;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/404.png',sizingMethod='scale');
position: absolute;
top: 0;
left: 0;
width: 100%;
}
引用 MSDN 中的说明:
这个滤镜中的
src
属性永远相对于页面的 URL 而不是 CSS 文件的,所以最好用绝对路径。background-size polyfill 能够解决
background-size
的兼容性问题。