【发布时间】:2019-01-06 10:07:31
【问题描述】:
我使用的是 Chrome 68。
每当我在<body> 上有filter: invert(xxx); 时,定位为fixed 的任何内容都不会粘在屏幕上,它会随所有内容滚动。
filter: invert(xxx);的演示
body{
height: 8000px;
filter: invert(0.85);
}
div{
position: fixed;
top: 0;
left: 0;
height: 100px;
width: 100px;
border: 1px solid black;
}
<div></div>
没有filter: invert(xxx);的演示
body{
height: 8000px;
}
div{
position: fixed;
top: 0;
left: 0;
height: 100px;
width: 100px;
border: 1px solid black;
}
<div></div>
编辑:在 Chrome 67 上运行良好,但在 Chrome 68 上不运行。
【问题讨论】:
-
有趣的错误,我在 FireFox (61.0.1) 上发现它,只有...
-
不过,我使用的是 Chrome。
-
Chrome 67.0.3396.99:完美运行... Chrome 68.0.3440.75:出现错误...
-
这似乎是 Chrome 68 的错误,我在 Chrome 67 上测试过,它工作正常。我正在添加标签。
-
使用
filter似乎是个问题——通过filter添加阴影也遇到了这个问题。filter为具有position: fixed在任何子主体级别的孩子创建一个新的位置上下文
标签: css google-chrome css-position css-filters