CSS3 & Modern Layouts (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
CSS Transitions vs. Keyframe Animations.
senior LevelSystem Design
In Simple Words:
- Transitions (
transition: transform 0.3s ease):- Animates property changes between two states triggered by user interaction (
:hover,:focus, class toggle). - Implicit (A to B). Cannot loop infinitely without JavaScript.
- Animates property changes between two states triggered by user interaction (
- Keyframe Animations (
@keyframes slideIn { ... }):- Complex multi-step animations (0%, 25%, 50%, 100%).
- Does not require a trigger; can start automatically on load, loop infinitely (
infinite), alternate directions (alternate), and stay on final state (animation-fill-mode: forwards).