【发布时间】:2023-03-25 14:46:01
【问题描述】:
我在伪元素的背景图像上使用了模糊滤镜。如果伪元素的 z-index 为 -1,则模糊在 Microsoft Edge 中无效。它在没有 z-index 的情况下工作。 (您必须通过 Edge 中的 about:flags 手动启用 CSS 过滤器)。
示例如下:http://codepen.io/anon/pen/WrZJZY?editors=110
这是由于实验支持(在 Edge 中)还是我在这里做错了什么?它适用于其他浏览器(Chrome、Safari、Firefox)。
.blur {
position:relative;
border: 4px solid #f00;
height:400px;
width:400px;
}
.blur:before {
content: "";
position: absolute;
width:400px;
height:400px;
z-index:-1;
background-image:url('https://i-msdn.sec.s-msft.com/dynimg/IC793324.png');
filter: blur(5px);
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='5');
}
【问题讨论】:
标签: css pseudo-element microsoft-edge css-filters