2012-07-28 156 views
0

我無法弄清楚爲什麼在Chrome瀏覽器中可以正常工作,但無法在Firefox中正常工作。CSS3動畫適用於Chrome瀏覽器,不適用於Firefox

我的代碼:

#header3{ 
    background: url(/images/mynecraft/clouds3.png) repeat-x center 20px; 
    -webkit-animation-name:cloud-crawl-header3; 
    -webkit-animation-duration: 120s; 
    -webkit-animation-timing-function:linear; 
    -webkit-animation-iteration-count:infinite; 
    -moz-animation-name:cloud-crawl-header3; 
    -moz-animation-duration:120s; 
    -moz-animation-timing-function:linear; 
    -moz-animation-iteration-count:infinite; 
} 
@-webkit-keyframes cloud-crawl-header3{ 
     from{background-position: -100% 20px, center top}to{background-position: 100% 20px, center top} 
} 
@-moz-keyframes cloud-crawl-header3{ 
     from{background-position: -100% 20px, center top}to{background-position: 100% 20px, center top} 
} 

什麼是與它的問題呢?

+1

爲什麼不直接使用[自由 - 前綴 - (http://leaverou.github.com/prefixfree/)? – 2012-07-29 14:22:27

回答

1

爲什麼你有兩組職位background-position這樣的:-100% 20px, center top

我覺得應該是:

@-webkit-keyframes cloud-crawl-header3 { 
    from { 
     background-position: -100% 20px; 
    } 
    to { 
     background-position: 100% 20px; 
    } 
} 

@-moz-keyframes cloud-crawl-header3 { 
    from { 
     background-position: -100% 20px; 
    } 
    to { 
     background-position: 100% 20px; 
    } 
} 
+0

有一個-moz-前綴和一個-webkit-前綴。沒有-moz-webkit-。 – 2012-07-29 14:21:16

+0

Typo。糾正。你對自己的讚譽是非常自由的:) – 2012-07-30 08:03:35

+0

你不能說它沒有引起你的注意:)編輯之後,它變成了+1。 – 2012-07-30 08:59:26

相關問題