This is a draft cheat sheet. It is a work in progress and is not finished yet.
Basics
*
.class
element
#id
selector1, selectorN, ...
Hierarchy
parent > child
ancestor descendant
prev + next
prev ~ siblings |
Basic Filters
:animated
:eq()
:even
:first
:gt()
:header
:lang()
:last
:lt()
:not()
:odd
:root
:target |
Content Filters
:contains()
:empty
:has()
:parent
Visibility Filters
:hidden
:visible
Attribute
[name|="value"]
[name*="value"]
[name~="value"]
[name$="value"]
[name="value"]
[name!="value"]
[name^="value"]
[name]
[name="value"][name2="value2"] |
Child Filters
:first-child
:first-of-type
:last-child
:last-of-type
:nth-child()
:nth-last-child()
:nth-last-of-type()
:nth-of-type()
:only-child
:only-of-type() |
|
|
|
|
|