css3中设置一个过渡效果,怎么让其一直止

2024-11-16 10:30:09
推荐回答(1个)
回答1:

用keyframes设置动画,然后animate应用动画
@keyframes myfirst {
0% {background: red;}
25% {background: yellow;}
50% {background: blue;}
100% {background: green;}
}
div {
animation: myfirst 5s linear infinite;
}