Javascript 固定位置和固定背景附件“忽略”chrome中的背景图像
以下是CSS:Javascript 固定位置和固定背景附件“忽略”chrome中的背景图像,javascript,html,css,google-chrome,Javascript,Html,Css,Google Chrome,以下是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.f
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>
铬的结果是:
在其他浏览器中,它会显示背景图像。如果我关闭position:fixed或background attachment:fixed,Chrome会正常显示。我猜这是一个Chrome bug。所以我的问题是。。。是否有一种方法可以至少为chrome打开后台附件:fixed属性?我已经用您的代码创建了JSFIDLE,它工作正常。检查小提琴我不知道问题出在哪里,因为我的iphone上也出现了问题。所以我刚刚删除了固定位置属性,现在一切都好了。