Every note on Mrs. Lastri’s board is a rule for the link colour on Mr. Harun’s banner: the browser answers the colour and which rules hit, then a duel of…
Why it matters
Most "my style does not apply" bugs are not typos: another rule is more specific. Once you read specificity as three columns, you can debug the cascade in seconds without sprinkling !important.
The key idea
Specificity is three columns, not one number
Common mistakes
The rule written last still loses Order only counts when the specificity ties exactly. #nav a (1,0,1) still beats .link (0,1,0) written after it. Lower the rival (say :where(#nav) a) or raise your rule in the same column.
Reaching for !important to make a rule win!important jumps to another layer, and the only way to beat it is another !important. That is how the war starts. Tidy the selectors instead: fewer IDs, :where() for defaults, or @layer.
Thinking an inline style is worth one ID The style attribute is not "1000 points": it is compared before specificity, so no selector can beat it, however many IDs it has. Only !important in a stylesheet wins.
Try it in this playground
Swap two rules whose specificity ties In "The active menu item", change rule 3 to .active a.link: (0,2,1), the same as rule 2. Then move it with the arrows. When every column ties, the lower one wins.
Wrap #nav in :where():where(#nav) a still filters, but its column A becomes 0. Watch the #nav piece turn grey.
Turn the inline style on, then beat it with !important A pile of IDs will never do. Only !important sits above the style attribute.
Mistype one pseudo-class in a comma list Say .link, a:hovr. One invalid selector throws the whole rule away, the valid .link with it.