← All Quizzes
What is the CSS cascade and what factors determine which rule wins?
Explanation
The CSS cascade resolves conflicts between multiple rules targeting the same element. The resolution order is: importance (!important vs normal), origin (author, user, user-agent), specificity (inline, ID, class, element), and source order (later rules win at equal specificity). Transitioning values have special cascade handling. The cascade ensures that styles are applied deterministically. Understanding it is essential for debugging why styles do or do not apply.