CSS Transitions
What are Transitions?
Transitions create smooth changes between property values. Perfect for hover effects, focus states, and interactive elements!
Basic Transition
Use transition to animate property changes. Hover over the
boxes to see the effect!
Transition Duration
transition-duration controls how long the transition takes.
Use seconds (s) or milliseconds (ms).
Timing Functions
transition-timing-function controls the speed curve:
ease, linear, ease-in,
ease-out, ease-in-out.
Transition Delay
transition-delay adds a pause before the transition
starts.
Multiple Properties
Transition multiple properties at once by separating them
with commas, or use all.
Transition Shorthand
Combine all transition properties:
transition: property duration timing-function delay.
Summary
transition-property- Which property to animatetransition-duration- How long (s or ms)transition-timing-function- Speed curvetransition-delay- Wait before starting- Shorthand:
transition: property duration timing delay - Use
allto transition all properties
Quick Quiz
Which timing function creates a constant speed transition?
Enjoying these tutorials?