2012-07-28 151 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

相关问题