Interview Question

What is transition in CSS?

A transition animates a property when its computed value changes.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

A CSS transition interpolates a property from an old value to a new value over time. • The changed property must support animation. • Duration, delay, property, and timing function control the transition. • User motion preferences should be respected for non-essential movement.

💡 Simple Example

.button { transition: background-color .2s ease; } .button:hover { background-color: navy; }

⚡ Quick Revision

A transition animates a property when its computed value changes.