Enter any CSS selector to get the (A, B, C) specificity score with visual breakdown.
Every CSS selector has a specificity score expressed as three numbers (A, B, C). When multiple rules target the same element and property, the rule with the highest specificity wins. The numbers are compared left to right — a higher A always beats a higher B or C.
| Selector type | Score | Example |
|---|---|---|
| Inline style (style="") | Always wins | style="color:red" |
| ID selector | A+1 | #header |
| Class selector | B+1 | .active |
| Attribute selector | B+1 | [type="text"] |
| Pseudo-class | B+1 | :hover, :nth-child(2) |
| Element / type selector | C+1 | div, span |
| Pseudo-element | C+1 | ::before, ::after |
| Universal selector, combinators | 0 | *, >, +, ~ |
:is(), :not(), :has() take the specificity of their most specific argument. :where() always contributes zero specificity.