๐Ÿฅ‡ CSS

CSS Specificity Explained โ€” Why Your Styles Don't Apply

๐Ÿ“… Jun 7, 2026 โฑ 4 min read

"My CSS isn't applying" is almost always a specificity fight. The browser scores every selector โ€” the higher score wins.

The scoring

So #sidebar a (101) beats .sidebar .menu .link.active (40) โ€” even though the second looks more specific.

Debugging in 30 seconds

DevTools โ†’ Elements โ†’ Styles panel. Struck-through rules lost the specificity fight; the winner shows on top with its selector.

How to stay out of trouble

More in the Complete CSS Guide.

โ† All Articles