我在谷歌的css3动画正在工作,但它不适用于Firefox

时间:2014-11-22 07:43:50

标签: css html5 css3

这是我制作的css3代码,它不会在firefox上运行

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

1 个答案:

答案 0 :(得分: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;

或使用lea verou的prefixfree