Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 动画仅适用于";“无限”;单词_Css - Fatal编程技术网

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; }
}