使锁链背景主题

时间:2019-06-16 11:01:14

标签: css background css-gradients

我想这样写一封链锁邮件:

chainmail background theme

我尝试过使用线性渐变,但似乎不起作用

    background: linear-gradient(#0c0c0c, #222222)!important

我希望输出像imgur所示的图像一样。线性渐变会起作用吗?

1 个答案:

答案 0 :(得分:5)

您可以使用radial-gradient

我使用了不同的颜色,所以我们可以更好地看到结果:

body {
  margin:0;
  height:100vh;
  background:
    radial-gradient(50% 100%,#000 35%,transparent 50%) 0   0  /10px 10px,
    radial-gradient(50% 100%,#000 35%,transparent 50%) 5px 5px/10px 10px,
    yellow;
}

您可以轻松地调整不同的值来控制大小:

body {
  margin:0;
  height:100vh;
  background:
    radial-gradient(50% 100%,#000 25%,transparent 50%) 0   0  /8px 8px,
    radial-gradient(50% 100%,#000 25%,transparent 50%) 4px 4px/8px 8px,
    yellow;
}

相关问题