📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials CSS Mastery Transitions

Transitions

5 min read Quiz at the end
Transitions animate property changes smoothly: transition: background-color 0.3s ease plays on hover. Add multiple properties separated by commas. Transitions play forward and reverse automatically with state changes.

CSS Transitions

.button {
    background: blue;
    color: white;
    transform: scale(1);

    /* transition: property duration easing delay */
    transition: background 0.3s ease,
                transform  0.2s ease;
}

.button:hover {
    background: darkblue;
    transform: scale(1.05);
}

/* Transition all properties */
.card {
    transition: all 0.3s ease;
}
Topic Quiz · 5 questions

Test your understanding before moving on

1. CSS transitions animate:
💡 Transitions animate the change between two states — like default to hover.
2. Which property sets transition duration?
💡 transition-duration: 0.3s sets how long the transition takes.
3. What does "ease" mean as easing function?
💡 ease is the default — slow start, faster middle, slow end.
4. Which CSS property should you transition for performance?
💡 transform and opacity are GPU-accelerated — use them for smooth 60fps animations.
5. transition: all 0.3s ease does what?
💡 transition: all transitions every changed property — convenient but slightly less performant.