CSS gradient checkerboard pattern

后端 未结 5 1986
夕颜
夕颜 2020-12-14 00:09

I want to create a checkerboard pattern using gradients. I\'ve found an example and modified it to my needs, however it only works with -moz prefix. When I remo

5条回答
  •  北海茫月
    2020-12-14 00:34

    It's 2020 and this can now be created with a single CSS gradient (if you don't need to support IE/ pre-Chromium Edge).

    html {
      background: repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 
                  50% / 20px 20px
    }

    A detailed explanation for how this works.

提交回复
热议问题