ie8中的全尺寸背景图像 [英] full size background image in ie8
本文介绍了ie8中的全尺寸背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在css中使用了这个属性,但它在IE8中不起作用
I used this property in css but its not working in IE8
html{
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/bg.jpg', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../images/bg.jpg', sizingMethod='scale')";
}
body {
background-image:url(../../images/bg.jpg);
background-repeat:no-repeat;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
}
我在stackoverflow上有很多解决方案,但没有一个能有效。
I got many solutions on stackoverflow but none of them worked.
我该如何解决这个问题?
How can I solve this?
推荐答案
试试这个
<div id="bg">
<img src="images/bg.jpg" alt="">
</div>
#bg {
position: fixed;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
}
#bg img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
min-width: 50%;
min-height: 50%;
}
这篇关于ie8中的全尺寸背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文