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 {
             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;
             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{
             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);
             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