CSS value transform关闭Firefox的background-attachment: fixed
下面是示例
div {
transform: translate3d(0,0,0); // if remove starts to work
width: 100%;
height: 2000px;
background-image: url('http://www.wallpapereast.com/static/images/001_Fish-Wallpaper-HD_hkNsK33.jpg');
background-size: cover;
background-attachment: fixed;
}
<div></div>
如果你从CSS中删除transform,它开始工作。
background-attachment:fixed;
不工作时,任何'转换'是应用
这是firefox的一个bug,目前还没有修复。
参考:https://bugzilla.mozilla.org/show_bug.cgi?id=1292499
这是一个常见的问题2年前,但据我所知,它已经解决了一段时间前,现在background-attachment
CSS属性现在完全支持所有的浏览器,根据MDN。
根据MDN文档,当涉及到动画时,大多数背景属性是离散的。除了background-size和background-position属性。
这个问题已经解决了。
长话短说,用position
代替background-attachment
。