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

วิธีหน่วงเวลาเอฟเฟกต์ Transition ด้วย CSS

ใช้คุณสมบัติ transition-delay เพื่อหน่วงเวลาเอฟเฟกต์ transition ใน CSS

ตัวอย่าง

<!DOCTYPE html> <html>    <head>       <style>          div {             width: 150px;             height: 150px;             background: blue;             transition: width 3s;             transition-delay: 1s;          }          div:hover {             width: 250px;          }       </style>    </head>    <body>       <h1>Heading One</h1>       <p>Hover over the below box to change its width. It begins with a delay of 1 second.</p>       <div></div>    </body> </html>