HTML + CSS
新年快乐动画代码如下:
<style>
div{
width: 300px;
height: 285px;
margin: 200px auto;
position: relative;
font-size: 40px;
text-align: center;
line-height: 285px;
color: red;
}
div img{
position: absolute;
top: 0;
left: 0;
opacity: 0;
transform: scale(0);
}
div img:nth-child(1){
animation: move 8s linear 0s;
}
div img:nth-child(2){
animation: move 8s linear 2s;
}
div img:nth-child(3){
animation: move 8s linear 4s;
}
div img:nth-child(4){
animation: move 8s linear 6s;
}
div img:nth-child(5){
animation: move 8s linear 8s;
}
@keyframes move{
0%{
opacity: 0;
transform: scale(0);
}
25%{
opacity: .5;
transform: scale(1);
}
50%{
opacity: 1;
transform: scale(2);
}
75%{
opacity: .5;
transform: scale(3);
}
100%{
opacity: 0;
transform: scale(4);
}
}
</style>
</head>
<body>
<div>
新年快乐
<img src="images/hua2.png" alt="">
<img src="images/hua2.png" alt="">
<img src="images/hua2.png" alt="">
<img src="images/hua2.png" alt="">
<img src="images/hua2.png" alt="">
</div>
</body>