為 CSS text-decoration-color 屬性新增動畫


如果要使用 CSS 對 text-decoration 屬性實現動畫效果,請嘗試執行以下程式碼 −

示例

實際演示

<!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>

更新日期:12-Jun-2020

174 次瀏覽

開啟你的 職業生涯

完成課程後獲得認證

開始
廣告
© . All rights reserved.