attribute, spacepval, dash-val, value
Select based on attributes or list of attributes or value of an attribute.
.big {color:blue }
Type selectors target every instance of an element, class selectors select any HTML element that has a class attribute.
div > em, "p em"
h2 + h3 {margin: -1em; }
Select all occurrences of h3 which are places after h2.
#navigation { width: 12em; color: #333; }#navigation
Select any HTML element that has an ID attribute, regardless of their position in the document tree
p ~ ul
Selects every UL element that are preceded by a P element.
active, first-child, focus, hover, lang, link, visited
after, before, first-letter, first-line
em {color: blue; }
Type selectors will select any HTML element on a page that matches the selector, regardless of their position in the document tree. For example:
This rule will select any <em> element on the page and color it blue.
<em>
* {color: blue; }
Universal selector.
id
class