enter image description here

body {
  font-family: sans-serif;
}
p {
  column-fill: balance;
  column-count: 2;
}

.box {
  width: 100px;
  height: 100px;
  background-color: red;
  filter: blur(5px);
  z-index: -1;
  animation: move 15s linear infinite;
}
.box2 {
  position: relative;
  width: 100vw;
  height: 100vh;
}
.box2::before {
  content: " ";
  position: absolute;
  top: -0px;
  left: -0px;
  bottom: -0px;
  right: -0px;
  background-image: conic-gradient(
    from 36deg at 20% 80%,
    #a100ffff 0% 25%,
    #000000 25% 30%,
    #119cfdff 30% 50%
  );

  filter: blur(500px);
  z-index: -1;
  animation: move 15s linear infinite;
}
@keyframes move {
  from {
    transform: rotate(180deg);
  }

  to {
    transform: rotate(540deg);
  }
}
<!DOCTYPE html>
<html>
  <head>
    <title>Parcel Sandbox</title>
    <meta charset="UTF-8" />
  </head>

  <body>
    <div id="app"></div>
    <script src="src/index.js"></script>
    <link rel="stylesheet" type="text/css" href="src/styles.css" />
    <div>
      <div class="box">1<br />12</div>
      <div class="box2">1<br />12</div>
    </div>
  </body>
</html>

它应该看起来像最左边的Firefox,但最近,它显示奇怪的线框.是的,不久前还不是这样.

我把代码和盒子放在一起来复制这个效果

https://codesandbox.io/

它应该看起来像最左边的Firefox

推荐答案

您可以使用3D变换强制激活硬件加速,以消除视觉瑕疵:

transform: rotate3D(0, 0, 1, 180deg);

不知道为什么它会发生在Chrome上,一定是最近引入的一个错误.

body {
  font-family: sans-serif;
}
p {
  column-fill: balance;
  column-count: 2;
}

.box {
  width: 100px;
  height: 100px;
  background-color: red;
  filter: blur(5px);
  z-index: -1;
  animation: move 15s linear infinite;
}
.box2 {
  position: relative;
  width: 100vw;
  height: 100vh;
}
.box2::before {
  content: " ";
  position: absolute;
  top: -0px;
  left: -0px;
  bottom: -0px;
  right: -0px;
  background-image: conic-gradient(
    from 36deg at 20% 80%,
    #a100ffff 0% 25%,
    #000000 25.5% 30%,
    #119cfdff 30.5% 50%
  );

  filter: blur(500px);
  background-color: white;
  z-index: -1;
  animation: move 15s linear infinite;
}
@keyframes move {
  from {
    transform: rotate3D(0, 0, 1, 180deg);
  }

  to {
    transform: rotate3D(0, 0, 1, 540deg);
  }
}
<!DOCTYPE html>
<html>
  <head>
    <title>Parcel Sandbox</title>
    <meta charset="UTF-8" />
  </head>

  <body>
    <div id="app"></div>
    <script src="src/index.js"></script>
    <link rel="stylesheet" type="text/css" href="src/styles.css" />
    <div>
      <div class="box">1<br />12</div>
      <div class="box2">1<br />12</div>
    </div>
  </body>
</html>

Css相关问答推荐

Tailwind CSS group-hover不适用于自定义前置码

如何将CSS Paint API与Reaction一起使用

本机CSS嵌套混乱

Astro网站在使用Astro Build构建后无法正常工作

带高度的容器查询不工作,但可随宽度调整

将鼠标悬停在具有效果的元素上

为什么align-content:start应用于单行项目?

为什么所有选项卡都没有显示在 React 的 MUI 选项卡组件中?

内部和外部 div 之间的像素大小的间隙

对 CSS 容器查询使用多个条件

如何在 Angular 中使用 CSS 设置 FontAwesome 图标的大小?

在移动设备上touch 屏幕边缘的元素(Material UI)

CSS动画恢复默认

Twitter Bootstrap:进度条居中文本

thead 和 tbody 之间的间距

我应该如何组织我的 CSS 文件的内容?

Select 标签的占位符

当子元素水平溢出时,为什么忽略父元素的右填充?

如何在 React 应用程序中使用 CSS 模块应用全局样式?

go 除文本输入的内阴影