您的位置:主页 > 前端教程 >

前端教程 CSS3制作旋转的太极图

2017-04-07作者:落花听雨来源:落花听雨次阅读

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style type="text/css" media="screen">
            *{margin:0;padding:0;}
            .container{width:200px;height:200px;margin:100px auto;background: linear-gradient(90deg,black 50%,white 50%);border-radius:50%;box-shadow: 0 0 4px #666666;animation:bonce 5s linear infinite;}
            .top,.bottom{height: 100px;width: 100px;margin: 0 auto;border-radius: 100px;overflow:hidden;}
            .inner1,.inner2{height:50px;width: 50px;margin: 25px auto;border-radius:50%; }
            .inner1{background: black}
            .inner2{background: white}
            .top{background: white}
            .bottom{background: black}
            @keyframes bonce{
                0%{-webkit-transform: rotate(0);
                   -moz-transform: rotate(0);
                    -ms-transform: rotate(0);
                     -o-transform: rotate(0);
                        transform: rotate(0);}
                100%{-webkit-transform: rotate(360deg);
                   -moz-transform: rotate(360deg);
                    -ms-transform: rotate(360deg);
                     -o-transform: rotate(360deg);
                        transform: rotate(360deg);}
            }
    </style>
</head>
<body>
       <div class="container">
             <div class="top">
                   <div class="inner1">
 
                   </div>
             </div>
             <div class="bottom">
                   <div class="inner2">
 
                   </div>
             </div>
       </div>
</body>
</html>

用到了css3的线性渐变animation动画,其中的布局也很巧妙,效果图如下
 

凡本站注明“本站”或“投稿”的所有文章,版权均属于本站或投稿人,未经本站授权不得转载、摘编或利用其它方式使用上述作品。本站已授权使用的作品,应在授权范围内使用,并注明“来源:某某站”并附上链接。违反上述声明者,本站将追究其相关法律责任。

编辑: 关键词: css3 太极图

网友评论

随机推荐

图文聚集

热门排行

最新文章