代码如下
<!-- 两个div -->
<div class="ball"></div>
<div class="ground"></div>
.ball {
width: 30px;
height: 30px;
background-color: black;
border-radius: 50%;
position: relative;
left: 90px;
animation: failing 0.5s ease-in infinite alternate;
}
.ground {
width: 200px;
height: 10px;
background-color: black;
}
@keyframes failing {
0% {
transform: translateY(-150px) scale(1, 1);
}
90% {
transform: scale(0.8, 1.2);
}
100% {
transform: translateY(0) scale(1.2, 0.8);
}
}
版权声明:本文为m0_37408390原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。