首页 > Web开发 > 详细

CSS实现太极效果

时间:2019-08-29 11:35:40      阅读:74      评论:0      收藏:0      [点我收藏+]

这个伪元素的位置对齐还妹搞明白 需要再研究研究

 

 
<html>
    <head>
        <title>taiji</title>
        <style>
            body{
                background-color: antiquewhite;
            }
            .box-taiji{
                z-index: 0;
                width: 0;
                height: 300px;
                position: relative;
                margin: 50px auto;
                border-left: 150px solid #000;
                border-right: 150px solid #fff;
                border-radius: 150px;
                -webkit-transition-property: -webkit-transform;
                -webkit-transition-duration: 1s;
                -moz-transition-property: -moz-transform;
                -moz-transition-duration: 1s;
                -webkit-animation: rotate 3s linear infinite;
                -moz-animation: rotate 3s linear infinite;
                -o-animation: rotate 3s linear infinite;
                animation: rotate 3s linear infinite;
            }
            @-webkit-keyframes rotate{from{-webkit-transform: rotate(0deg)}
                to{-webkit-transform: rotate(360deg)}
            }
            @-moz-keyframes rotate{from{-moz-transform: rotate(0deg)}
                to{-moz-transform: rotate(359deg)}
            }
            @-o-keyframes rotate{from{-o-transform: rotate(0deg)}
                to{-o-transform: rotate(359deg)}
            }
            @keyframes rotate{from{transform: rotate(0deg)}
                to{transform: rotate(359deg)}
            }
            .box-taiji::after{
                z-index: 1;
                width: 150px;
                height: 150px;
                position: absolute;
                top: 0;
                left: -80px;
                content: ‘‘;
                display: block;
                background:#000;
                border-radius: 75px;
                box-shadow: 0 150px 0 #fff;
            }
            .box-taiji::before{
                content:‘‘;
                position: absolute;
                display: block;
                width:50px;
                height:50px;
                left: -30px;
                top: 45px;
                z-index:2;
                background-color:#fff;
                border-radius:50%;
                box-shadow:0 150px 0 #000;
            }
        </style>
    </head>
    <body>
        <div class="box-taiji">
        </div>
    </body>
</html>

 

CSS实现太极效果

原文:https://www.cnblogs.com/qq965921539/p/11428214.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!