Selector Playground

Type a CSS selector. See every part, its specificity, and what to watch out for.

Up to 1,000 characters. The breakdown updates locally as you type. No input is put in the URL.

Specificity

#nav .link:hover > a::before
(1,2,2)
Selector source

Selector anatomy

Selector 1: #nav .link:hover > a::before (1,2,2)

Breakdown of #nav .link:hover > a::before
PartKindIDsClassesTypesWhy
#navID100Adds 1 to the first column.
spaceCombinator000Combinators add nothing.
.linkClass010Adds 1 to the second column.
:hoverPseudo-class010Adds 1 to the second column, like a class.
>Combinator000Combinators add nothing.
aType001Adds 1 to the third column.
::beforePseudo-element001Adds 1 to the third column, like a type.
Total122(1,2,2)

Underlines show the column: solid for IDs, dashed for the class column, dotted for the type column, double for functional pseudo-classes. Read how specificity is calculated.