簡體   English   中英

CSS動畫:可以在Chrome瀏覽器中使用,但不能在Firefox中使用?

[英]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;
}

http://jsfiddle.net/WsWWY/

當前的Firefox實施會失敗,除非時間值0帶有單位。 使用0s0ms

http://jsfiddle.net/WsWWY/1/

注意: W3C明確允許數字0(不帶單位)作為長度值,但對於其他值則沒有這種意義。 我個人希望這種情況有所改變,但目前Firefox的行為並不正確。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM