Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

คุณสมบัติ CSS ชื่อแอนิเมชั่น


ใช้ ชื่อแอนิเมชั่น คุณสมบัติเพื่อตั้งชื่อแอนิเมชั่น @keyframes

คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้งาน ชื่อแอนิเมชั่น คุณสมบัติ:

ตัวอย่าง

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 150px;
            height: 200px;
            background-color: yellow;
            animation-name: myanim;
            animation-duration: 3s;
            animation-delay: 3s;
         }
         @keyframes myanim {
            from {
               background-color: green;
            }
            to {
               background-color: blue;
            }
         }
      </style>
   </head>
   <body>
      <div></div>
   </body>
</html>