[英]CSS Animation: Works in Chrome but not in Firefox?
在旋轉動畫中,只能在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
。
注意: W3C明確允許數字0(不帶單位)作為長度值,但對於其他值則沒有這種意義。 我個人希望這種情況有所改變,但目前Firefox的行為並不正確。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.