【发布时间】:2017-09-03 17:04:04
【问题描述】:
所以我找到了this google doodle,我想知道如何使用 CSS 进行这种旋转(google doodle 是一个 gif)。看起来它只围绕一个轴旋转,如果我在 CSS 中进行旋转,它会围绕 x 和 y 轴旋转。这可以通过 3D 旋转实现吗(从未使用过,所以我不知道)。
我在JSfiddle做了一个基本的例子。
HTML:
<div class="rotatediv">
</div>
CSS:
.rotatediv {
background-color: red;
width:500px;
height:500px;
animation-name:rotate_animation;
animation-duration: 15s;
animation-delay:0s;
animation-iteration-count: infinite;
}
@keyframes rotate_animation {
0% {transform: rotate(0deg);}
100% {transform: rotate(360deg);}
}
【问题讨论】:
标签: css animation transform css-animations