我的css代码适用于chrome和safari,但不适用于Firefox,IE和Opera.当我创建@keyframes rotate {}时,对于其他浏览器,这不适用于这4行:
animation-duration: 4s;
animation-timing-function: linear;
animation-name:"rotate";
animation-iteration-count: infinite;
或者对于keyframe方法?我怎样才能解决这个问题?
CSS:
@-webkit-keyframes rotate {
0% {
-webkit-transform:translate(73px, 73px) rotate(0deg) translate(-73px, -73px) rotate(0deg);
background-color:#2187e7;
background-image: -moz-linear-gradient(90deg, #2187e7 25%, #a0eaff);
background-image: -webkit-linear-gradient(90deg, #2187e7 25%, #a0eaff);
}
13% {
-webkit-transform:translate(73px, 73px) rotate(45deg) translate(-73px, -73px) rotate(-45deg);
}
25% {
-webkit-transform:translate(73px, 73px) rotate(90deg) translate(-73px, -73px) rotate(-90deg);
}
38% {
-webkit-transform:translate(73px, 73px) rotate(135deg) translate(-73px, -73px) rotate(0deg);
}
50% {
-webkit-transform:translate(73px, 73px) rotate(180deg) translate(-73px, -73px) rotate(-180deg);
}
63% {
-webkit-transform:translate(73px, 73px) rotate(225deg) translate(-73px, -73px) rotate(225deg);
} …Run Code Online (Sandbox Code Playgroud)