1、通过滤镜的方法
body {
background:url()no-repeatcenter;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
filter: progid: DXImageTransform.Microsoft.AlphaImageLoader( src='', sizingMethod='scale');
-ms-filter: progid: DXImageTransform.Microsoft.AlphaImageLoader( src='', sizingMethod='scale');
}
2、通过htc文件(通过计算屏幕尺寸控制img标签尺寸,模拟background-size:cover;效果)
[css]view plaincopy
you can use this file (https://github.com/louisremi/background-size-polyfill “background-size polyfill”) for IE8that is really simple to use:
.selector {
background-size: cover;
-ms-behavior:url(/backgroundsize.min.htc);
}
网友评论