CSS动画之小球围绕旋转

让我为大家带来一个关于小球围绕的案例吧!

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 {
            position: relative;
            width: 300px;
            height: 300px;
            margin: 30px auto;
            border-radius: 50%;
            border: 10px solid red;
            animation: runing 3s infinite linear;
        }

        .ball {
            position: absolute;
            left: 60px;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background-color: orange;
        }

        @keyframes runing {
            form {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }
    style>
head>

<body>
    <div class="box">
        <div class="ball">div>
    div>
body>

html>

CSS动画之小球围绕旋转_第1张图片

感谢大家的阅读,如有不对的地方,可以向我提出,感谢大家!

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