Css 动画仅适用于";“无限”;单词
我试图将动画设置为#元素,但动画仅在我使用“无限”字时才起作用: 当我使用数字而不是“无限”时,它不起作用 我只想播放一次动画。 我也尝试了下一个代码:Css 动画仅适用于";“无限”;单词,css,Css,我试图将动画设置为#元素,但动画仅在我使用“无限”字时才起作用: 当我使用数字而不是“无限”时,它不起作用 我只想播放一次动画。 我也尝试了下一个代码: #Element { animation-name: ANIMATION !important; animation-duration: .5s !important; animation-iteration-count: infinite !important; } @-moz-keyframes ANIMATION {
#Element
{
animation-name: ANIMATION !important;
animation-duration: .5s !important;
animation-iteration-count: infinite !important;
}
@-moz-keyframes ANIMATION {
0% { background: GREEN; }
100% { background: RED; }
}
@keyframes ANIMATION {
0% { background: RED; }
100% { background: GREEN; }
}
我在Firefox Nightly 22.0a1(2013-03-23)上使用它。制作一个JSFIDLE来复制这个问题,让我们看看。你能删除
吗!重要信息
从您的#元素
中删除,然后重试?另外,请检查示例。
#Element
{
animation-name: ANIMATION !important;
animation-duration: .5s !important;
animation-iteration-count: infinite !important;
}
@-moz-keyframes ANIMATION {
0% { background: GREEN; }
100% { background: RED; }
}
@keyframes ANIMATION {
0% { background: RED; }
100% { background: GREEN; }
}