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

CSS animation-direction Property

ใช้คุณสมบัติ animation-direction เพื่อกำหนดว่าแอนิเมชันควรเล่นไปข้างหน้า ถอยหลัง หรือสลับกัน

ตัวอย่าง

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