CSS Specificity Calculator
Understand the cascade faster by seeing the exact inline, ID, class, and element contribution of every selector fragment.
Selector A
0,1,2,1Inline
0
ID
1
Class
2
Element
1
#headeridID selectors add 0,1,0,0.
0,1,0,0
.navclassClass selectors add 0,0,1,0.
0,0,1,0
>combinatorCombinators affect matching structure but do not change specificity.
0,0,0,0
aelementElement selectors add 0,0,0,1.
0,0,0,1
:hoverpseudo-classPseudo-classes add 0,0,1,0.
0,0,1,0
Quick reference
Inline style
1,0,0,0#id
0,1,0,0.class / [attr] / :hover
0,0,1,0element / ::before
0,0,0,1* and combinators
0,0,0,0:where(...)
0,0,0,0