【发布时间】:2016-09-06 04:42:23
【问题描述】:
我正在尝试使用 HTML、CSS 创建旋转地球效果。我用 CSS 创建了地球。我想像地球一样旋转图像。
CSS:
#rotate{
position: fixed;
border: 1px solid #111;
border-radius: 50%;
overflow:hidden;
width:100px;
height:100px;
box-shadow: inset 1px 8px 16px #000;
}
.earth{
-webkit-animation-name: rotate;
-webkit-animation-duration: 4s;
animation-iteration-count: infinite;
animation-name: rotate;
animation-duration: 4s;
}
@-webkit-keyframes rotate{
from{transform: translate(0px);}
to{transform: translate(100px);}
}
HTML:
<div id="rotate"><img class="earth" src="http://laps.noaa.gov/albers/sos/earth/globe/globe_animated_2k.gif" alt="globe"/></div>
【问题讨论】:
标签: javascript jquery html css