美文网首页
css动画-太极图

css动画-太极图

作者: ssttIsme | 来源:发表于2020-03-07 19:28 被阅读0次

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>太极图</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            .box{
                position: relative;
                width: 240px;
                height: 120px;
                margin: 100px auto;
                border-style:solid ;
                border-width: 1px 1px 120px 1px;
                border-radius: 50%;
                animation: rot 2s infinite linear;
            }
            .box:before{
                content: "";
                position: absolute;
                top: 50%;
                left: 0;
                width: 40px;
                height: 40px;
                background-color: #fff;
                border-radius: 50%;
                border: 40px solid #000;
            }
            .box:after{
                content: "";
                position: absolute;
                top: 50%;
                left: 50%;
                width: 40px;
                height: 40px;
                background-color: #000000;
                border-radius: 50%;
                border: 40px solid #fff;
            }
            @keyframes rot {
                0%{
                    transform: rotate(0deg);
                }
                100%{
                    transform: rotate(360deg);
                }
            }
        </style>
    </head>
    <body>
        <div class="box"></div>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:css动画-太极图

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