我正在寻找一个有效的解决方案,以动画 html5 / {{3中progress webkit元素的background-position
属性}}
HTML:
<progress max="100" value="0"></progress>
CSS:
progress[value]::-webkit-progress-bar {
-webkit-animation: moveBackground 2s steps(30) infinite;
background-image: repeating-linear-gradient(to right, green 0%, orange 50%, blue 100%);
background-size: 30rem;
}
@-webkit-keyframes moveBackground
{
0% {
background-position: 0 0;
}
100% {
background-position: -50rem 0;
}
}
小提琴:blink
但是,https://jsfiddle.net/6gekeegg/支持background-position
属性的动画,简单示例:
progress[value] {
...
}