Recall & Review
beginner
What does the CSS cascade mean?
The CSS cascade is the way the browser decides which CSS rules to apply when multiple rules target the same element. It follows a set of priorities to pick the winning style.
Click to reveal answer
beginner
Name the three main factors that affect the CSS cascade order.
The three main factors are: 1) Importance (like !important), 2) Specificity (how specific the selector is), 3) Source order (which rule comes last in the CSS).
Click to reveal answer
beginner
What is specificity in CSS cascade?
Specificity is a score that the browser gives to CSS selectors based on how specific they are. More specific selectors override less specific ones.
Click to reveal answer
beginner
How does the browser handle conflicting CSS rules with the same specificity?
If two rules have the same specificity, the browser applies the one that comes last in the CSS code (source order).
Click to reveal answer
beginner
What role does the !important declaration play in the CSS cascade?
The !important declaration makes a CSS rule override other rules, even if they have higher specificity or come later in the source order.
Click to reveal answer
What does the CSS cascade help the browser decide?
✗ Incorrect
The CSS cascade decides which CSS rule wins when multiple rules apply to the same element.
Which factor has the highest priority in the CSS cascade?
✗ Incorrect
The !important declaration overrides other rules regardless of specificity or source order.
If two CSS rules have the same specificity, which one applies?
✗ Incorrect
When specificity is equal, the rule that comes last in the CSS code wins.
What does specificity measure in CSS?
✗ Incorrect
Specificity measures how specific a CSS selector is to determine priority.
Which of these selectors has the highest specificity?
✗ Incorrect
ID selectors (#header) have higher specificity than class selectors (.button), element selectors (button), or universal selectors (*).
Explain how the CSS cascade decides which style to apply when multiple rules target the same element.
Think about rule importance, how specific selectors are, and the order of rules.
You got /4 concepts.
Describe what specificity means in CSS and why it matters in the cascade.
Consider how the browser scores selectors to pick the winning style.
You got /3 concepts.