CSS Specificity Calculator
Calculate and compare CSS selector specificity values
Specificity Rankings
Highest(A, B, C)
#main-nav ul li a:hover
1
1
3
.container > p.highlight
0
2
1
body main section[data-theme="dark"]
0
1
3
div
0
0
1
Scoring Ruleset
Bucket A — IDsMatches #id selectors
Bucket B — Classes & AttributesMatches .class, [attr], and :hover pseudo-classes
Bucket C — Type & Pseudo-elementsMatches element tags (div, p) and ::before / ::after
Inline styles and !important override author stylesheet specificity.