使用 CSS 動畫製作 vertical-align 屬性動畫


要使用 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.