使用 CSS 動畫設定垂直對齊屬性


要使用 CSS 在 vertical-align 屬性上實現動畫,你可以嘗試執行以下程式碼 −

示例

線上演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         img {
            vertical-align: 80px;
            animation: myanim 3s;
         }
         @keyframes myanim {
            50% {
               vertical-align:120px;
            }
         }
      </style>
   </head>
   <body>
      <h1>CSS vertical-align property</h1>  
      <div></div>
      <p><img src="https://tutorialspoint.tw/latest/microservice_architecture.png" width = "80" height = "80">
         This is demo text. This is demo text. This is demo text. This is demo text.
      </p>
   </body>
</html>

更新時間: 12-6 月-2020

463 次觀看

開啟你的 職業生涯

完成課程即可獲得認證

立即開始
廣告
© . All rights reserved.