转动的八卦图纯css实现

 

 

  这类的东西网上一搜就是大把的,看着比较空旷的博客,所以自己也来写一个。

复制代码
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
            #yin-yang{
                position: absolute;
                margin:auto;
                top:0;
                right:0;
                bottom:0;
                left:0;
                /*上面一段代码是垂直居中定位*/
                width:192px;
                height:96px;
                background-color:white ;
                border-color: black;
                border-style: solid;
                border-width: 2px 2px 98px 2px;
                border-radius: 100%;
                animation-name: turn;   /*动画名称*/
                animation-delay: 1s;  /*动画延迟时间*/
                animation-direction: normal; /*动画效果有反复交递等*/
                animation-duration: 1s;   /*动画执行时间*/
                animation-timing-function: linear; /*动画执行方法此为匀速方法*/
                animation-iteration-count: infinite; /*执行动画的次数此为无限次数*/
            }
            #yin-yang:before{
                content:'';
                position: absolute;
                top:50%;
                left:0;
                width:24px;
                height:24px;
                background-color: white;
                border:36px solid black;
                border-radius: 100%;
            }
            #yin-yang:after{
                content:'';
                position: absolute;
                top:50%;
                right: 0;
                width:24px;
                height:24px;
                background-color: black;
                border:36px solid white;
                border-radius: 100%;
            }
            @keyframes turn{
                0{transform: rotate(0);}
                100%{transform: rotate(360deg);}
            }
        </style>
    </head>
    <body>
        <div id="yin-yang"></div>
    </body>
</html>
复制代码

转载于:https://www.cnblogs.com/zuiai/p/7108290.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值