Joc*_*i93 6 css animation css3
我正在尝试创建一个初学者的CSS3动画.它适用于Chrome,Opera和Safari,但不适用于Internet Explorer(11)和Firefox(34.0)
我正在使用-moz-前缀,但它不起作用......我不知道为什么.
body{
width:100%;
}
#center{
width:900px;
margin:0 auto;
height:800px;
display:block;
}
#center .box{
width:100px;
height:100px;
background-color:black;
margin:0 auto;
-webkit-animation: myfirst 5s; /* Chrome, Safari, Opera */
animation: myfirst 5s; /*Explorer*/
-moz-animation: myfirst 5s; /*Mozilla*/
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
@-webkit-keyframes myfirst{
from{backgrond:black;}
to{background:yellow;}
}
@-moz-keyframes myfirst{
from{background:black;}
to{background: :yellow;}
}
@keyframes myfirst {
from{background:black;}
to{background: :yellow;}
}
Run Code Online (Sandbox Code Playgroud)
您需要更正:关键帧内的拼写错误
在这里检查小提琴
\n\n#center .box{\n width:100px;\n height:100px;\n margin:0 auto;\n background-color:black;\n -webkit-animation: myfirst 5s; /* Chrome, Safari, Opera */\n -webkit-animation-iteration-count: infinite; /*V\xc3\xa9gtelen \xc3\xbajraj\xc3\xa1tsz\xc3\xa1s */\n -moz-animation: myfirst 5s; /*Mozilla*/\n -moz-animation-iteration-count: infinite;\n animation: myfirst 5s; /*Explorer*/\n animation-iteration-count: infinite;\n}\n\n@-webkit-keyframes myfirst{\n from{background:black;}\n to{background:yellow;}\n}\n\n@-moz-keyframes myfirst{\n from{background:black;}\n to{background:yellow;}\n}\n\n@keyframes myfirst {\n from{background:black;}\n to{background:yellow;}\n}\nRun Code Online (Sandbox Code Playgroud)\n