代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>缓冲</title>
<style>
@keyframes test{
from{
margin-top : 10px;
}
to{
margin-top: 70px;
}
}
.box{
width: 170px;
height: 100px;
border-radius: 25px;
padding-left: 50px;
margin: 200px auto;
background-color: tan;
position: relative;
}
.box1{
position: absolute;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: white;
animation: test 0.5s infinite alternate-reverse ;
}
.box2{
position: absolute;
left: 75px;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: white;
animation: test 0.5s infinite alternate-reverse 0.1s;
}
.box3{
position: absolute;
left: 100px;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: white;
animation: test 0.5s infinite alternate-reverse 0.2s;
}
.box4{
position: absolute;
left: 125px;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: white;
animation: test 0.5s infinite alternate-reverse 0.3s;
}
.box5{
position: absolute;
left: 150px;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: white;
animation: test 0.5s infinite alternate-reverse 0.4s;
}
</style>
</head>
<body>
<div class="box">
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
<div class="box5"></div>
</div>
</body>
</html>
34.jpg
网友评论