Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> CSS

Tạo hiệu ứng chuyển động cho thuộc tính CSS vertical-align


Để thực hiện animation trên thuộc tính vertical-align với CSS, bạn có thể chạy đoạn mã sau:

Ví dụ

<!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://www.tutorialspoint.com/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>