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 margin-bottom


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

Ví dụ

<!DOCTYPE html> <html>    <head>       <style>          p {             animation: mymove 3s infinite;             margin-bottom: 20px;          }          @keyframes mymove {             70% {                margin-bottom: 60px;             }          }       </style>    </head>    <body>       <p>This is demo text! This is demo text! This is demo text!          This is demo text! This is demo text! This is demo text!          This is demo text! This is demo text! This is demo text!          This is demo text! This is demo text! This is demo text!       </p>       <p>This is demo text 2!</p>    </body> </html>