Link Search Menu Expand Document

CSS Selector

Table of contents


CSS Selector Reference

Selectors

SelectorExample
elementp
.class 
#id 
[attribute=”value”][img src=”url”]
element:nth-child(n)p:nth-child(2)
→ 2nd <p> of its parent
* (all) 

Operators

OperatorExampleDescription
ORelement,element,(comma)
AND.class1.class2(no whitespace)
descendantelement element(whitespace)
childelement>element>