div
{
width:50px;
height:50px;
background:red;
position:relative;
animation-name:myfirst;
animation-duration:4s;
animation-timing-function:linear;
animation-delay:2s;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-play-state:running;
}
@keyframes myfirst
{
0% {background:red; left:0px; top:0px;}
50% {background:yellow; left:200px; top:0px;}
100% {background:red; left:0px; top:0px;}
}
CSS3动画
最新推荐文章于 2022-12-15 14:38:50 发布