28

background-attachment: fixedCSS 值转换在 Firefox 中关闭。

这是示例

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 中删除转换,它就会开始工作。只能在 FF 中重现。

4

3 回答 3

6

background-attachment:fixed;应用任何“转换”时都不起作用

这是Firefox中的一个错误,尚未修复。

参考:https ://bugzilla.mozilla.org/show_bug.cgi?id=1292499

于 2018-08-09T13:11:16.760 回答
1

这是 2 年前常见的问题,但据我所知,它已经解决了一段时间,现在background-attachmentCSS 属性现在已被所有浏览器完全支持,根据 MDN

于 2018-08-25T18:28:47.637 回答
-2

这个问题已经解决了。

长话短说,使用position而不是background-attachment

于 2017-03-28T10:51:43.733 回答