<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>浮动</title>
<style type="text/css">
.box{
margin: 0 auto;
width: 500px;
height: 300px;
border: 1px solid #000;
}
.a2{
width: 50px;
height: 80px;
background-color: red;
line-height: 100px;
margin:100px 24px 0px ;
float:left;
border-radius: 5px;
animation:scale 0.5s ease infinite alternate both;
}
.a3{
width: 50px;
height: 80px;
background-color: blue;
margin:100px 24px 0px;
float: left;
border-radius: 5px;
animation:scale 0.5s ease 0.1s infinite alternate both;
}
.a4{
width: 50px;
height: 80px;
background-color: green;
margin:100px 24px 0px;
float: left;
border-radius: 5px;
animation:scale 0.5s ease 0.2s infinite alternate both;
}
.a5{
width: 50px;
height: 80px;
background-color:pink;
margin:100px 24px 0px;
float: left;
border-radius: 5px;
animation:scale 0.5s ease 0.3s infinite alternate both;
}
.a6{
width: 50px;
height: 80px;
background-color:greenyellow;
margin:100px 24px 0px;
float: left;
border-radius: 5px;
animation:scale 0.5s ease 0.4s infinite alternate both;
}
.loading p{
width:500px;
height: 50px;
margin-top:250px;
text-align: center;
}
@keyframes scale{
from{
transform:scaleY(0.8);
}
to{
transform:scaleY(1.5);
}
}
</style>
</head>
<body>
<div class="box">
<div class="a2"></div>
<div class="a3"></div>
<div class="a4"></div>
<div class="a5"></div>
<div class="a6"></div>
<div class="loading">
<p>loading...</p>
</div>
</div>
</body>
<html>