Rules to remember
- Compare a first, then b, then c — one ID (1,0,0) beats any number of classes (0,15,0).
- When specificity is equal, the rule that comes last wins.
:where()always adds 0;:is(),:not()and:has()count their most specific argument.- The universal selector
*and combinators (>, +, ~) add nothing. - Inline styles beat selectors, and
!importantbeats both.
Frequently asked questions
Why is my CSS not applying?
Another rule probably has higher specificity or comes later. Compare them here.
How do I lower specificity?
Use single classes, avoid IDs in CSS and wrap selectors in :where().
Is it free?
Yes.

