【发布时间】:2016-06-21 16:32:49
【问题描述】:
Demo page
body {
-webkit-filter: blur(2px);
filter: blur(2px);
}
div {
background: blue;
margin: auto;
position: absolute;
right: 0;
top: 50%; /* <---- ignored */
left: 0;
height: 200px;
width: 200px;
transform: translateY(-50%);
}
<div></div>
将filter:blur(1px)(或任何其他filter)提供给定位元素(Firefox)的父元素会使浏览器忽略子元素的位置。
有没有人遇到过这种情况并知道解决这种烦恼的方法?
在 FF48 beta / win7 上测试
【问题讨论】:
-
如果我们可以给父元素高度 "height: 500px;".child 位置会起作用。
-
我有same issue。我向 Firefox 提交了bug,我还要求 W3C 向change the spec 提供与大小/位置无关的过滤器。