希望明天越|

张尊娟

园龄:5年3个月粉丝:31关注:1

css3旋转小样例

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            background-color: #000;
        }
        .dibu {
            width: 500px;
            height: 500px;
            /* background-color: #fff; */
            margin: 100px auto;
            border-radius: 50%;
            border: 20px solid #aca;
            position: relative;
            animation: xuanzhuan 2s linear infinite;
 
        }
        .dibu::before{
            content: '';
            display: block;
            width: 500px;
            height: 500px;
            border-radius: 50%;
            border-top: 20px solid rgb(230, 255, 2);
            border-left: 20px solid rgb(230, 255, 2);
            border-right: 20px solid transparent;
            border-bottom: 20px solid transparent;
            position: absolute;
            top: -20px;
            left: -20px;
          
        }
        .r{
            width: 250px;
            height: 20px;
            /* background-color:rgb(230, 255, 2); */
            background-color: transparent;
            position: absolute;
            top: 241px;
            transform: rotate(136deg);           
            transform-origin: right;
            
        }
        .r::before{
            content: '';
            display: block;
            background-color:rgb(230, 255, 2);
            width: 50px;
            height: 50px;
            border-radius: 50%;
            position: absolute;
            top:-14px;
            left: -34px;
        }
        @keyframes xuanzhuan {
        
         0%{transform: rotate(0deg);}  
        100%{ transform: rotate(360deg);}   
        
    }
    </style>
</head>

<body>
    <!-- 固定大圈 -->
    <div class="dibu">
        <div class="r"></div>
    </div>
</body>

</html>

本文作者:张尊娟

本文链接:https://www.cnblogs.com/wszzj/p/14109518.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   张尊娟  阅读(32)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起