css旋转小球

css旋转小球_第1张图片

DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Documenttitle>
    <style>
        .box{
            margin: 100px auto;
            width: 200px;height: 200px;
            /* transparent 透明的 */
            background: transparent;
            border: 5px solid black;
            border-radius: 50%;
            position: relative;
            animation: round 3s infinite linear;
        }
        .box::before{
            position: absolute;
            top:0px;left:28px;
            width: 30px;height: 30px;background: yellow;
            border-radius: 50%;
            content: "";
        }
        /* 动画 */
        @keyframes round {
            0%{rotate: 0deg;}
            100%{rotate: 360deg;}
        }
    style>
head>
<body>
    <div class="box">div>
body>
html>

你可能感兴趣的:(css,前端)