美文网首页
CSS3边框圆角太极

CSS3边框圆角太极

作者: 562843cce5ff | 来源:发表于2019-05-03 23:27 被阅读0次

    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>
    

    相关文章

      网友评论

          本文标题:CSS3边框圆角太极

          本文链接:https://www.haomeiwen.com/subject/vcjtoqtx.html