您的位置:首页技术文章
文章详情页

css - animation颜色变化的问题

浏览:36日期:2023-06-15 16:13:55

问题描述

css - animation颜色变化的问题

这是初始颜色值

具体看demo

但是写上动画效果后颜色值就变了,这个是什么原因,怎么可以让动画颜色和初始值颜色一致

问题解答

回答1:

问题出在使用了step(2);

animation-timing-function改成step(1);bg方法改成0%和50%;

.min-circle:nth-child(2n - 1) { -webkit-animation: bg 2s steps(1) infinite; animation: bg 2s steps(1) infinite;}@keyframes bg { 0% { background: #ff3c18; } 50% { background: #ffea67; }}

标签: CSS
相关文章: