CSS Transitions
CSS
What is a CSS Transition?
A CSS Transition lets you gradually change property values (like color, size, position) over time, instead of instantly.
When you hover over the button, the background color fades smoothly from blue to green in 0.3 seconds.
Property | What it does |
---|---|
transition-property | Which property to animate (color, width, all, etc.) |
transition-duration | How long the animation lasts (0.5s, 200ms) |
transition-timing-function | How the speed changes (ease, linear, ease-in-out, cubic-bezier) |
transition-delay | Wait before starting the transition |