為 CSS 屬性底部設定動畫效果


要使用 CSS 在底部屬性上實現動畫,可以嘗試執行以下程式碼

示例

實際演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 200px;
            height: 300px;
            background: yellow;
            border: 10px solid red;
            animation: myanim 3s infinite;
            bottom: 30px;
            position: absolute;
         }
         @keyframes myanim {
            20% {
               bottom: 100px;
            }
         }
      </style>
   </head>
   <body>
      <h2>Performing Animation for bottom property</h2>
      <div></div>
   </body>
</html>

更新時間:2020 年 6 月 25 日

1K+ 瀏覽量

啟動你的 職業生涯

透過完成課程獲得認證

開始
廣告