太极图

2021-04-11  本文已影响0人  MSmileL
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>太极图</title>
    <style>
        body {
            margin: 0;
        }

        /* 大圈 */
        .box1 {
            position: relative;
            width: 500px;
            height: 500px;
            margin: 20px auto;
            border: 1px solid black;
            border-radius: 50%;
            box-sizing: border-box;
            overflow: hidden;
        }

        /* 分割为左右两块 */
        .box1::before,
        .box1::after {
            position: absolute;
            content: '';
            width: 250px;
            height: 500px;
        }

        .box1::before {
            left: 0;
            background-color: #000;
        }

        .box1::after {
            right: 0;
            background-color: #fff;
        }

        /* 中圈 */
        .box2,
        .box3 {
            position: absolute;
            width: 250px;
            height: 250px;
            left: 50%;
            margin-left: -125px;
            border-radius: 50%;
            box-sizing: border-box;
            z-index: 1;
        }

        .box2 {
            top: -1px;
            background-color: #000;
        }

        .box3 {
            bottom: 0;
            background-color: #fff;
        }

        /* 小圈 */
        .box2::after,
        .box3::after {
            position: absolute;
            top: 50%;
            left: 50%;
            margin-top: -25px;
            margin-left: -25px;
            content: '';
            width: 50px;
            height: 50px;
            border-radius: 50%;
        }

        .box2::after {
            background-color: #fff;
        }

        .box3::after {
            background-color: #000;
        }
    </style>
</head>

<body>
    <div class="box1">
        <div class="box2"></div>
        <div class="box3"></div>
    </div>
</body>

</html>
img.jpg
上一篇下一篇

猜你喜欢

热点阅读