我正在尝试使用 backdrop-filter: blur 制作一个带有玻璃效果的工具提示,除了该滤镜似乎不适用于绝对位置的元素。 我想这是因为该元素已脱离文档流,因此无法识别背景,但可能有解决方法来解决它。
image: the filter does not act on elements in absolute position
最佳答案
我发现透明背景的元素被错误地模糊了。我想知道这个元素的父元素是否是具有透明背景的元素。
在我的例子中,我的 body 是透明的,这使得模糊不起作用,并解决了这个问题:
body {
background-color: white;
}
关于css - 背景过滤器 : Blur not working on a position absolute element,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66324118/