CSS Table Reference

Selectors

Selector Example Example Description
.class .intro Selects all elements with the class="intro"
.class1.class2 .name1.name2 Selects all elements with both name1 and name2 set within its class attribute
.class1 class2 .name1 .name2 Selects all elements with name2 that is a descendant of an element with name1
#id #firstname Selects the element with id="firstname"
* * Selects all elements
element p Selects all "p" elements
element.class p.intro Selects all "p"elements with class="intro"
element, element div, p Selects all "div" elements and all "p" elements
element element div p Selects all "p" elements inside "div" elements
element>element div > p Selects all "p" elements where the parent is a "div" element
element+element div + p Selects the first "p" element that are placed immediately after "div" elements
element1~element2 p ~ ul Selects every "ul" element that are preceded by a "p" element
[attribute] [target] Selects all elements with a target attribute
[attribute=value] [target=_blank] Selects all elements with target=_blank

For more information or selectors, go to w3schools.com.