我发现 Firefox 中的背景附件存在问题。 我想固定我的横幅背景(http://inkerkam.so-use.ru/),但它在 firefox 中不起作用:显示背景,但它滚动,但在 chrome 中它正常工作。再过一会儿,在“.content”下面的另一个 block 中它也正常工作。
我的 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 版本是最后一个。今天更新。
附注抱歉我的英语不好
最佳答案
即使没有其余代码,我也几乎可以肯定问题出在具有背景的元素或父元素中的 transform:translate
属性。应用此属性时 - 对于任何轴,X
、Y
或 Z
,background-attachment:fixed
被禁用。
关于css - 背景附件 "fixed"在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42483972/