對 CSS 顏色屬性執行動畫


要使用 CSS 對顏色屬性實現動畫,你可以嘗試執行以下程式碼

示例

線上演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 200px;
            height: 300px;
            background: white;
            border: 10px solid red;
            animation: myanim 3s infinite;
            bottom: 30px;
            position: absolute;
         }
         @keyframes myanim {
            20% {
               bottom: 100px;
               box-shadow: 30px 45px 70px orange;
               color: blue;
            }
         }
      </style>
   </head>
   <body>
      <h2>Performing Animation on color property</h2>
      <div>This is our demo div!</div>
   </body>
</html>

更新時間:2020-06-25

104 次瀏覽

開啟你的職業生涯

透過完成該課程獲得認證

開始學習
廣告
© . All rights reserved.