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 text-decoration-color


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

Ví dụ

<!DOCTYPE html> <html>    <head>       <style>          #demo {             position: absolute;             right: 0;             width: 300px;             height: 200px;             background-color: blue;             text-decoration: underline;             animation: myanim 3s infinite;          }          @keyframes myanim {             30% {                right: 350px;                text-decoration-color: orange;             }          }       </style>    </head>    <body>       <h1>CSS text-decoration-color property</h1>       <div id = "demo">          <h1>This is demo text.</h1>       </div>    </body> </html>