html - 文本上的混合混合模式错误

标签 html css google-chrome mix-blend-mode

我正在使用 mix-blend-mode 属性处理剔除文本。当我打开控制台以使用开发人员工具测试响应能力时,混合文本上方和下方出现和消失的小线条。在每次选择时,我在开发人员工具控制台的设备选择器上进行操作,都会出现此错误。以下是一些示例:

页面大小已调整为 iPad Pro 尺寸

enter image description here

页面大小已调整为 Pixel 2XL 尺寸

enter image description here

这是我用来创建此文本的代码:

.backdrop {
  background: url("https://rpsthecoder.github.io/img-repo/Taitō%20by%20Jezael%20Melgoza.jpg") center;
  background-size: contain;
  margin: auto;
  margin-top: 40px;
  width: 75vw;
}

.text {
  font: bolder 20vw "Arial";
  text-align: center;
  margin: 0;
}

.screen {
  color: black;
  mix-blend-mode: screen;
  background-color: #fff;
}
<div class="backdrop">
  <p class="text screen">Taitō</p>
</div>

我注意到,当您在 Codepen 上运行代码时,不会发生此错误。我不明白这是为什么。但是,它可能发生在简单的静态 HTML 文件上。

我尝试使用描述的will-change: opacityherehere ,但我没有运气。

我的 Chrome 版本是版本 78.0.3904.108。此错误仅发生在 Chrome 上。如果有人能就此提出建议,我将不胜感激。

最佳答案

如果您注重结果,那么此解决方案可能会帮助您解决此问题。我还检查了 mix-blend-mode 但正如你所说,Chrome 中存在问题。

我使用了background-clip: text来达到相同的结果。

页面大小已调整为 iPad Pro 尺寸

enter image description here

页面大小已调整为 Pixel 2XL 尺寸

enter image description here

请告诉我这是否有帮助。

.backdrop {
  margin: auto;
  margin-top: 40px;
  width: 75vw;
}
.text {
  font: bolder 20vw "Arial";
  text-align: center;
  margin: 0;
}
.screen {
  color: transparent;
  background: url("https://rpsthecoder.github.io/img-repo/Taitō%20by%20Jezael%20Melgoza.jpg") center;
  -webkit-background-clip: text;
  background-clip: text;
  background-size: contain;
}
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
  <div class="backdrop">
    <p class="text screen">Taitō</p>
  </div>
</body>
</html>

关于html - 文本上的混合混合模式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59097885/

相关文章:

google-chrome - CSS 过渡、动画具有糟糕的性能、行为

html - 如何在顺风CSS上将垂直文本放在水平文本旁边

javascript - 水平菜单重叠图像 slider

html - 即使在使用显示 :inline-block 后,社交媒体图标也不会出现在一行中

javascript - 网页 : Animated clouds -- overflow and middle mouse click?

ruby-on-rails - CSS 样式 time_ago_in_words rails

html - 带有半透明黑色背景的白色文本框 - 需要灯箱吗?

javascript - 我如何让图像像在谷歌相册 View 中那样流动

javascript - 关于可点击的下拉菜单

html - PERSISTENT 文件系统存储与 chrome 存储在哪里?