小球落下的动画
<!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>
.outer{
height: 300px;
border-bottom: 10px solid black;
margin: 0 auto;
overflow: hidden;
}
.box2{
width: 50px;
height: 50px;
border-radius: 50%;
background-color: chartreuse;
animation:boll 3s forwards ease-in infinite;
}
@keyframes boll {
from{
margin-top: 0px;
}
33%{
margin-top: 250px;
}
66%{
margin-top: 100px;
animation-timing-function: ease-out;
}
to{
animation-timing-function: ease-in;
margin-top: 250px;
}
}
</style>
</head>
<body>
<div class="outer">
<div class="box2"></div>
</div>
</body>
</html>