css教程网 css教程网365css.cn
公告为您打开互联网世界的窗户关于本站

不规则色块

border-radius 八个值,捏出有机形状。

结构

HTML
<div class="blob"></div>

样式

CSS
.blob {
  width: 120px; height: 110px;
  background: linear-gradient(140deg, #2b57ff, #b06bff);
  border-radius: 62% 38% 46% 54% / 55% 45% 55% 45%;
  animation: morph 6s ease-in-out infinite alternate;
}
@keyframes morph {
  to { border-radius: 38% 62% 63% 37% / 41% 58% 42% 59%; }
}

复制后可直接使用;如果要放进已有项目,注意把类名改成你项目里的命名,避免冲突。