2014-11-22 62 views
1

这里是我做的CSS3代码和它并不运行在Firefox在谷歌我的CSS3动画工作,但它不工作在Firefox上

@keyframes moveobject { 
    0% {top: 0px; background: red; width: 100px;} 
    100% {top: 200px; background: yellow; width: 300px;} 
} 
+0

我只是用你的代码做了一个jsfiddle,它在Firefox中工作正常。 http://jsfiddle.net/57xarc6q/我打算建议厂商前缀,但他们已经支持了一段时间http://caniuse.com/#search=css-animation – 2014-11-22 08:01:03

+0

它确实在firefox上移动先生..现在它不适用于谷歌浏览器:( – Jon 2014-11-22 08:14:49

回答

1

添加供应商前缀

@-webkit-keyframes moveobject { 
    0% {top: 0px; background: red; width: 100px;} 
    100% {top: 200px; background: yellow; width: 300px;} 
} 

@-moz-keyframes moveobject { 
    0% {top: 0px; background: red; width: 100px;} 
    100% {top: 200px; background: yellow; width: 300px;} 
} 

@keyframes moveobject { 
    0% {top: 0px; background: red; width: 100px;} 
    100% {top: 200px; background: yellow; width: 300px;} 
} 


-webkit-animation: moveobject 5s infinite; 
-moz-animation: moveobject 5s infinite; 
animation: moveobject 5s infinite; 

或使用prefixfree by lea verou

相关问题