Cai*_*ifa 16 html css css3 css-animations
在旋转动画中,适用于Chrome但不适用于Firefox.为什么?
@-moz-keyframes rotate {
from { -moz-transform: rotate(0deg); }
to { -moz-transform: rotate(360deg); }
}
@-webkit-keyframes rotate {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
#example {
background: red;
width: 100px;
height: 100px;
-moz-animation: rotate 20s linear 0 infinite;
-webkit-animation: rotate 20s linear 0 infinite;
}
Run Code Online (Sandbox Code Playgroud)
koj*_*iro 29
除非0具有单位的时间值,否则当前的Firefox实现会失败 使用0s或0ms.
注意:W3C明确允许数字0(没有单位)为长度值,但是对于其他值没有这样的说法.就个人而言,我希望这会改变,但目前Firefox的行为并不正确.