【发布时间】:2016-01-27 12:06:08
【问题描述】:
我有一个我创建的手的图像,我试图让手看起来好像它正在放弃。图像最初应该是原始形式,即手指向上指向左侧的位置,然后在 4 秒内,我希望手慢慢向右旋转到 70 度点。现在它在 70 度点用手指加载并且什么都不做。
我做错了什么?
#blue {
background-color: blue;
}
.hand {
width: auto;
height: 400px;
position: relative;
-webkit-animation-name: wave; /* Chrome, Safari, Opera */
-webkit-animation-duration: 4s; /* Chrome, Safari, Opera */
-webkit-animation-iteration-count: 1; /* Chrome, Safari, Opera */
-webkit-animation-direction: normal; /* Chrome, Safari, Opera */
animation-name: wave;
animation-duration: 4s;
animation-iteration-count: 1;
animation-direction: normal;
}
@keyframes wave {
from,100% {
-ms-transform: rotate(75deg); /* IE 9 */
-webkit-transform: rotate(75deg); /* Chrome, Safari, Opera */
transform: rotate(75deg);
}
<div id="blue">
<img src="http://optimumwebdesigns.com/images/hand.png" class="hand">
</div>
【问题讨论】:
-
语法错误,应该是
from { ... } to { ... } -
从关键帧块中删除
from,。 -
我这样做了,但它什么也没做... ` @keyframes wave { from {0%}, to {100%} {`
-
@Becky:很抱歉在一个不相关的线程上发表评论,但在我发表评论之前你已经删除了你的问题。如果您只是在寻找有关如何制作边框绘制动画的想法,请查看 - stackoverflow.com/questions/31198304/…。
-
@Harry 非常感谢您的帮助!这就是我一直在寻找的。一些东西可以引导我朝着正确的方向前进。我尝试搜索许多不同的东西,但没有出现我正在寻找的东西。我遇到了诸如太阳系自转之类的事情。谢谢!!!
标签: html css animation css-transitions