Problem Statement
How does a transition differ from an animation in CSS?
Explanation
Transitions are triggered when a property changes (like hover). Animations run continuously using keyframes. Transitions are simpler and event-based; animations are timeline-based.
Code Solution
SolutionRead Only
div:hover { background: red; transition: background 0.3s; }Practice Sets
This question appears in the following practice sets:
