我发现在Firefox中存在背景附着问题。我想让我的横幅背景固定不动(http://inkerkam.so-use.ru/),但在Firefox中无效:背景显示,但是它会滚动,然而在Chrome中它可以正常工作。另外一个问题是,在另一个名为“content”的块下面,它也可以正常工作。
我的HTML代码:
<div class="banner">
...
</div>
...
<div class="content">
....
</div>
我的CSS:
.banner {
background: url(/template/img/banner.jpg) no-repeat fixed left top;
}
.content {
background: url(/template/img/banner.jpg) 0px -690px fixed;
padding: 80px 0 120px 0;
}
也许有人知道如何解决这个问题? Firefox版本是最新的。今天更新了。
附言:对我的糟糕英语表示抱歉。
background-attachment
不是很适合视差效果,因为它在许多移动浏览器上不受支持,并且还会导致每一帧都要重新绘制。更好的选择(如果您的布局允许)是使用perspective
和translateZ
。详见:https://developers.google.com/web/updates/2016/12/performant-parallaxing。 - Justin Taddei