css3中设置一个过渡效果,怎么让其一直保持过渡效果而不返回原来的状态

2025-04-14 01:25:21
推荐回答(1个)
回答1:

用keyframes设置动画,然后animate应用动画

@keyframes myfirst {
    0%   {background: red;}
    25%  {background: yellow;}
    50%  {background: blue;}
    100% {background: green;}
}
div {
    animation: myfirst 5s linear infinite;
}

Via. http://w3school.com.cn/css3/css3_animation.asp