<meta charset="utf-8">
<style>
.animated {
animation-duration: 3s; /*動畫時間*/
animation-fill-mode: both; /*播放後的狀態*/
animation-iteration-count: infinite; /*動作循環的次數:infinite 無限循環*/
}
.icon-hot {
animation-duration: 0.8s; /*動畫時間*/
animation-fill-mode: both; /*播放後的狀態*/
animation-iteration-count: infinite; /*動作循環的次數:infinite 無限循環*/
animation-name:upAnimation; /*動畫的名稱*/
}
@keyframes upAnimation{
0%,
43%{
transform: translate3d(0,1px,0);
}
70%{
transform: translate3d(0,-3px,0px);
}
90%{
transform: translate3d(0,1px,0);
}
}
</style>
<img src="//www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png" alt="" class="animated icon-hot">
<div>你好</div>