执行 CSS 颜色属性动画


若要使用 CSS 来为 color 属性添加动画效果,请尝试运行以下代码

示例

在线演示

<!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 年 6 月 25 日

104 浏览

开启你的 职业生涯

通过完成课程获得认证

开始
广告
© . All rights reserved.