【发布时间】:2016-08-23 06:56:54
【问题描述】:
我正在尝试模糊包装 div 内的背景 Div。
当我过渡子 div(被模糊的 div)的不透明度时,模糊似乎在过渡期间传播到父元素,导致羽化边缘,然后在之后自行移除。
HTML / Jade
div
div( class="bg" style="background: url('http://placekitten.com/300') no-repeat center center; background-size: cover;")
SCSS
div {
cursor: pointer; cursor: hand;
.bg{
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
transition: 550ms ease-out;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
transform: scale(1.1);
}
}
div {
position: relative;
height: 500px; width: 500px;
overflow: hidden;
background-color: rgba( 0, 0, 0, 1);
}
div:hover {
.bg {
opacity: .6;
}
}
这是一个显示错误的代码笔。 (发生在 chrome 中)
http://codepen.io/LAzzam2/pen/kXdwWp
有人知道有什么办法解决这个问题吗?谢谢!
【问题讨论】: