CSS3邊框圓角太極

CSS3 太極

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 500px;
            height: 500px;
            background-color: skyblue;
            border: 1px solid #000;
            margin: 0 auto;
            margin-top: 100px;
            position: relative;
            overflow: hidden;
        }

        .wrap {
            width: 400px;
            height: 400px;
            border-radius: 50%;
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            right: 0;
            margin: auto;
            box-shadow: 0px 0px 10px 10px #fff;
            animation: rotate 10s linear 0s infinite normal;
        }
        @keyframes rotate {
            from{
                transform: rotateZ(0deg);
            }
            to{
                transform: rotateZ(360deg);
            }
        }

        .top {
            width: 400px;
            height: 200px;
            box-sizing: border-box;
            background-color: #fff;
            border-top-left-radius: 200px 200px;
            border-top-right-radius: 200px 200px;
        }

        .bottom {
            width: 400px;
            height: 200px;
            background-color: #000;
            border-bottom-left-radius: 200px 200px;
            border-bottom-right-radius: 200px 200px;
        }

        .left, .right {
            width: 200px;
            height: 200px;
            box-sizing: border-box;
            border-radius: 50%;
        }

        .left {
            position: absolute;
            left: 0;
            top: 100px;
            background-color: #fff;
            border: 50px solid #000;
        }

        .right {
            position: absolute;
            right: 0;
            top: 100px;
            background-color: #000;
            border: 50px solid #fff;
        }
    </style>
</head>
<body>
<div class="box">
    <div class="wrap">
        <div class="top"></div>
        <div class="bottom"></div>
        <div class="left"></div>
        <div class="right"></div>
    </div>
</div>
</body>
</html>
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容