太极图的3种方法

万物负阴而抱阳,冲气以为和

五个Div

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>太极图</title>
    <style>
        body{
            background-color: #ccc;
        }
        /* 左半白又半黑 */
        .box1{
            width: 400px;
            height: 400px;
            border-radius: 50%;
            background-color: #fff;
            margin: 100px auto;
            background-image: linear-gradient(to right, #fff 50%,#000 50%); 
        }
        /* 中黑圆 */
        .box2{
            width: 200px;
            height: 200px; 
            background-color: #000;
            margin: 0 auto ;
            border-radius: 50%;
            box-sizing: border-box;
            padding: 75px;
        }
        /* 中白圆 */
        .box3{
            width: 200px;
            height: 200px;
            background-color: #fff;
            box-sizing: border-box;
            margin: 0 auto ;
            border-radius: 50%;
            padding: 75px;
        } 
        /* 小白圆 */
        .box4{
            width: 50px;
            height: 50px;
            background-color:#fff;
            margin: 0 auto ;
            border-radius: 50%;
        }
        /* 小黑圆 */
        .box5{
            width: 50px;
            height: 50px;
            background-color: #000;
            margin:0 auto;
            border-radius: 50%;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2">
            <div class="box4"></div>
        </div>
        <div class="box3">
            <div class="box5"></div>
        </div>
    </div>
</body>
</html>

3个Div


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>太极图</title>
    <style>
        body{
            background-color:#ccc;
        }
        .box1{
            width: 400px;
            height: 400px;
            background: linear-gradient(to right,#fff 50%,#000 50%) no-repeat;
            border-radius: 50%;
            margin: 100px auto;
        }
        .box2{
            width: 50px;
            height: 50px;
            background-color: #fff;
            border-radius: 50%;
            border: 75px solid black;
            margin: 0 auto;
        }
        .box3{
            width: 50px;
            height: 50px;
            background-color: black;
            border-radius: 50%;
            border: 75px solid #fff;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2"></div>
        <div class="box3"></div>
    </div>
</body>
</html>

一个Div

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>太极图</title>
    <style>
        body{
            background-color: #ccc;
        }
        div{
            width: 400px;
            height: 400px;
            margin: 100px auto;
            border-radius: 50%;
            background: 
            radial-gradient(#fff 25px,#000 25px,#000 70%,transparent 71%) 100px 0/200px 200px no-repeat,
            radial-gradient(#000 25px,#fff 25px,#fff  70%,transparent 71%) 100px 200px/200px 200px no-repeat,
            linear-gradient(to right,#fff  50%,#000 50%) no-repeat;
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值