@keyframes scaleDraw { /*定義關鍵幀、scaleDrew是須要綁定到選擇器的關鍵幀名稱*/ 0%{ transform: scale(1); /*開始爲原始大小*/ } 25%{ transform: scale(1.5); /*放大1.1倍*/ } 50%{ transform: scale(1); } 75%{ transform: scale(1.5); } } .showImg { width: 20px; height: 20px; animation: scaleDraw 5s ease-in-out infinite; }
<img src="" class="showImg " alt="">