#classname
.classname
element.classname
*classname
#example
.example
element#example
example
parent > child
parent child
parent .child
parent + child
Every odd-numbered child element of its parent
Every even-numbered child element of its parent
Only the first child element of its parent
All child elements of its parent
:first-line
:line-first
:first-letter
:line-start
:link
:visited
:active
:hover
Select all elements
Select all elements except the specified selector
Select only the first child of its parent
Select only the last child of its parent
tag
id
class
both class and tag
focus
hover
active
checked
:nth-child(last)
:last-child
:only-child
:nth-last-child(1)
input:checked
input:focus
input:hover
input:active
Selects the first child of an element
Selects all sibling elements
Selects the immediately next sibling of an element
Selects the parent of an element
Selects all elements
Selects all siblings after a specified element
Selects only the first sibling of a specified element
Selects only the last sibling of a specified element
[attr]
[attr=""]
[attr=*]
attr[ ]
ul > li
ul li
ul + li
ul ~ li
content p
p.content
.content > p
p .content
Match the CSS Selector with Its Description
A →1, B →5, C → 3, D → 4
A → 2, B → 3, C → 1, D → 4
A → 2, B → 6, C → 4, D → 3
A → 5, B → 3, C → 2, D → 4
Match the CSS Sub-Selector with Its Meaning
A → 2, B → 1, C → 3, D → 6
A → 2, B → 1, C → 3, D → 4
A → 2, B → 5, C → 3, D → 4
A → 5, B → 1, C → 3, D → 4
Match the CSS Attribute Selector with Its Function
A → 2, B → 6, C → 3, D → 4
Match the CSS User Action Pseudo-Class with Its Effect
A → 4, B → 3, C → 2, D → 1
A →5, B → 4, C → 3, D → 2
A → 6, B → 2, C → 3, D → 4
A → 5, B → 2, C → 3, D → 6