Phong Duong

🔎Search

How to create pattern with CSS #3

21-08-2020 | #css

<div></div>
:root {
  --red: red;
  --yellow: yellow;
  --transparent: #0000;
}
div {
  min-height: 100vh;
  background: radial-gradient(
      var(--transparent) 0 3.5rem,
      var(--yellow) 3.5rem 4rem,
      var(--transparent) 4rem
    ), radial-gradient(
      at 0 0,
      var(--transparent) 0 3.5rem,
      var(--yellow) 3.5rem 4rem,
      var(--transparent) 4rem
    ), radial-gradient(
      at 0 100%,
      var(--transparent) 0 3.5rem,
      var(--yellow) 3.5rem 4rem,
      var(--transparent) 4rem
    ), radial-gradient(
      at 100% 0,
      var(--transparent) 0 3.5rem,
      var(--yellow) 3.5rem 4rem,
      var(--transparent) 4rem
    ), radial-gradient(
      at 100% 100%,
      var(--transparent) 0 3.5rem,
      var(--yellow) 3.5rem 4rem,
      var(--transparent) 4rem
    ), var(--red);
  background-size: 8rem 8rem;
}

Result

Pattern 3

Share: TwitterFacebookLinkedInHacker News