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>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容