基本上,圆像轮胎一样从左向右旋转。我尝试应用变换旋转360,但无法正常工作。
html:
<div class="circle"></div>
css:
.circle{
height: 100px;
width: 100px;
background-color: green;
border-radius: 10px;
-webkit-animation:movespin 4s ease-in-out;
animation:movespin 4s ease-in-out;
}
@-webkit-keyframes movespin {
0% {
transform: translateX(0px);
transform:rotate(360deg);
}
100% {
transform: translateX(900px);
transform:rotate(360deg);
}
}
答案 0 :(得分:4)
将它们放在一起。
.circle {
height: 100px;
width: 100px;
background-color: green;
border-radius: 10px;
-webkit-animation: movespin 4s ease-in-out;
animation: movespin 4s ease-in-out;
}
@-webkit-keyframes movespin {
0% {
transform: translateX(0px) rotate(0deg);
}
100% {
transform: translateX(900px) rotate(360deg);
}
}
<div class="circle"></div>