css-filters - 更改页面上另一个元素的混合混合模式时,背景过滤器不起作用

标签 css-filters mix-blend-mode

浏览器版本为 Chrome 87.0.4280.88

这是我偶然发现这个错误的方法:

  • There are two independent divs on the page and both are position: fixed;
  • One of them has a hover effect with which its mix-blend-mode is changed.
  • The other one has glassmorphism style on it with backdrop-filter: blur(...px);
  • The filter works only when the other element on the page is set to mix-blend-mode: normal; otherwise it looks like as if it was not supported.

无论如何,我现在将停止使用悬停效果,但如果有什么技巧,那么让全世界都知道它会很好。

最佳答案

也遇到过这个错误(Chrome 90)。

快速修复:

将任何 backdrop-filter 规则添加到应用了 mix-blend-mode 规则的同一元素。

示例:

.blend {
  mix-blend-mode: difference;
  backdrop-filter: opacity(1); /* fixes the chrome-bug */
}

关于css-filters - 更改页面上另一个元素的混合混合模式时,背景过滤器不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66204563/

相关文章:

html - 混合混合模式背景与子内容不受影响

css - Firefox 上具有变换 3D 和滤镜模糊的背景中心

html - Css,我想模糊边框而不模糊div的内容

css - 硬件加速时在 Chrome 中剪辑时不正确的 CSS 模糊渲染

html - 仅将 CSS 混合模式应用于边框

html - 为什么我不能在 mix-blend-mode 之后应用 css 过滤器?

flutter - 如何在 flutter 中使用混合混合模式?

javascript - 动态应用多个 css 过滤器

CSS3技巧: blur entire webpage but without softened borders?

javascript - 根据背景更改固定位置div的背景和字体颜色