【CSS】使用渐变画一个太极图案

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
  <style>
    body{
      background: lightblue;
    }
    div{
      width: 500px;
      height: 500px;
      background: linear-gradient(white 50%,black 50%);
      margin: 100px auto;
      display: flex;
      align-items: center;
      border-radius: 50%;
    }
    div::before{
      content: "";
      display: block;
      width: 250px;
      height: 250px;
      background: radial-gradient(white 25%,black 30%);
      border-radius: 50%;
    }
    div::after{
      content: "";
      display: block;
      width: 250px;
      height: 250px;
      background: radial-gradient(black 25%,white 30%);;
      border-radius: 50%;
    }
  </style>
</head>
<body>
<div></div>
</body>
</html>

posted @ 2022-06-05 08:57  木子欢儿  阅读(36)  评论(0编辑  收藏  举报