<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS音阶动画</title>
<style>
.box{
width: 100px;
background: red;
}
.box .main{
margin-left: 10px;
}
@-webkit-keyframes list
{
0% {
-webkit-transform: scaley(1);
transform: scaley(1); }
50% {
-webkit-transform: scaley(0.4);
transform: scaley(0.4);
}
100% {
-webkit-transform: scaley(1);
transform: scaley(1);
}
}
@keyframes list
{
0% {
-webkit-transform: scaley(1);
transform: scaley(1); }
50% {
-webkit-transform: scaley(0.4);
transform: scaley(0.4); }
100% {
-webkit-transform: scaley(1);
transform: scaley(1); }
}
.list> div {
background-color: #fff;
width: 3px;
height: 18px;
border-radius: 2px;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
display: inline-block;
-webkit-animation: list 0.9s 0s infinite cubic-bezier(.85, .25, .37, .85);
animation: list 0.9s 0s infinite cubic-bezier(.85, .25, .37, .85);
}
.list> div:nth-child(1), .list> div:nth-child(2) {
-webkit-animation-delay: 0.2s !important;
animation-delay: 0.2s !important;
}
.list> div:nth-child(3), .list> div:nth-child(4) {
-webkit-animation-delay: 0.4s !important;
animation-delay: 0.4s !important;
}
</style>
</head>
<body>
<div class="box">
<div class="main">
<div class="list">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</div>
</body>
</html>