我找到了 FF 和 Chrome 的修复程序。IE 和 Safari 显示的页面非常糟糕:
HTML:
<div id="header">'
<div id="headerPic" style="background: url(Bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Bg.jpg', sizingMethod=scale);
-ms-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Bg.jpg', sizingMethod=scale);">
<div id="headerContent">
...
</div></div></div>
CSS:
#header {
position:fixed;
display: block;
top:0px; left:0px; right:0px;
width: 100%px;
z-index:5;
overflow: hidden;
height: 215px;
}
#headerPic {
width: 100%; height: 100%;
background: url(images/restaurantsBg.jpg) no-repeat center center fixed;
background-size: 100%;
}
#headerContent {
width: 701px;
margin: 0 auto;
height: 215px;
background: rgba(255,255,255, 0.80);
/* Colors: transparency, r, g, b
/* For IE 5.5 - 7 */
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#d0ffffff, endColorstr=#d0ffffff);
/* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#d0ffffff, endColorstr=#d0ffffff)"
}