【发布时间】:2015-04-06 21:36:23
【问题描述】:
我在下面有一个 div 动画,它从下到上反复转换。
0px to -20px to 0px to -20px to 0px.... 但我希望它像这样翻译
0px to -20px to 5px to -20px to 0px to -20px to 5px to -20px to 0px
HTML
<div id="main">
<div id="example"></div>
</div>
CSS
#main{
border-bottom: 1px solid black;
}
#example{
width: 100px;
height: 100px;
border: 1px solid black;
-webkit-animation: example 0.5s linear 0s infinite alternate;
}
@-webkit-keyframes example {
from {transform:translate(0px,0px);}
to {transform:translate(0px,-20px);}
}
【问题讨论】:
标签: css css-transitions css-animations css-transforms