这是CSS:
body > .section {
width: 100%;
height: 1080px;
min-height: 1080px;
position: relative;
z-index: 10;
}
body > .section.fixed {
position: fixed;
top: 0px;
left: 0px;
z-index: 5;
}
body > .section.fixed-next {
margin-top: 1080px;
}
#city {
background-image: url('../img/bg_baku1.jpg');
background-position: 50% center;
background-repeat: no-repeat;
background-attachment: fixed;
color: white;
}
html,
<div class="section fixed" id="city">
<!-- Content here -->
</div>
<div class="section fixed-next" id="contact">
<!-- Content here -->
</div>
Chrome中的结果:http://imgur.com/6DMehtR
在每个其他浏览器中,它显示背景图像。如果我关闭position:fixed
或background-attachment: fixed
,Chrome会正常显示。我猜这是一个Chrome bug。所以我的问题是......有没有办法我至少可以为{?}提供background-attachment: fixed
属性?