cheat sheets.

$ cheat css_selectors
CSS Selectors, CSS 1
-----
E	     An element of type E
S1 S2	     Any selector S1 with descendant match S2 (not just children)
E F          ... such as element E with descendant element F
E.myclass    Element E marked with class "myclass"
E#myid       ... with a document ID of "myid"
E:link       ... which is an unvisited link
E:visited    ... which is a visited link
E:active     ... which is activated (such as between mouse down and up)
E:hover      ... with a pointing device within its boundaries
E:focus	     ... which has input device focus
E::first-line	 The first formatted line of E element
E::first-letter	 The first formatted letter of E element
S1, S2       Matches S1 or S2

CSS Selectors, CSS 2
-----
*	      Special name matching any element
S1 > S2	      Selector S1 with child matching S2
S1 + S2	      Selector S1 with immediately following sibling matching S2
E[attr]	      an E element with a "attr" attribute
E[attr="val"]  ... whose value is exactly equal to "val"
E[attr~="val"] ... whose value includes "val" as a whitespace-separated element
E[attr|="en"]  ... whose value is "en" or begins with "en-" (link[hreflang])
E:first-child E element, first child of its parent
E:lang(fr)    E element in language "fr" (*[lang] or *[xml:lang])
E::before     Generated content before E element (see style 'content')
E::after      Generated content after E element (see style 'content')
Version 2, updated 156 days ago.
. o 0 ( | previous | history | revert to | current | diff )
( add new | see all )