在旋转动画中,只能在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; }
当前的Firefox实施失败,除非时间值0具有单位。使用0s或0ms。
0
0s
0ms
注意:W3C明确允许数字0(不带单位)作为长度值,但对于其他值则没有这种意义。我个人希望这种情况有所改变,但目前Firefox的行为并不正确。