让我为大家带来一个关于小球围绕的案例吧!
<!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>
.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>
感谢大家的阅读,如有不对的地方,可以向我提出,感谢大家!