我有背景图片。我正在扩展它,以便它适合整个页面。但它在IE以外的浏览器中工作。但如果我使用background-size,它在IE9中工作。但我希望它能在IE8中工作。这个怎么做?提前致谢。在IE中伸展背景图片
在其他浏览器和在IE9:
在IE8:
您可以在页面底部的差异。 这里是我的代码:
body, html{
height:100%;
padding:0;
margin:0;
}
body.BodyBackground {
margin: 0px;
background: url(../images/common/header/Background_color.png);
background-repeat:repeat-x;
background-attachment:fixed;
background-position:top center;
height: 100%;
width: 100%;
border: 0;
background-size:contain;
display:inline-block;
background-color: transparent;
}
div.content{
height:100%;
width:97%;
background-color: rgb(255, 255, 255);
margin: 0px 25px 25px 25px;
height:470px;
background-position:center;
background-repeat:no-repeat;
background-attachment:fixed;
}
'background:url(../ images/common/header/Background_color.png)#yourColorFromBottomOfImage;' – Morpheus 2013-05-10 09:19:37
我没有得到你。你能不能更清楚些? – mukund 2013-05-10 09:22:12
只需在photoshop(或任何其他软件)中打开背景图像并抓住图像的底部颜色即可。然后用你抓的颜色替换我的'#yourColorFromBottomOfImage'。 – Morpheus 2013-05-10 09:23:55