非常簡單的animation動畫

<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>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章