0% found this document useful (0 votes)
89 views

css3 Selectors Cheatsheet PDF

This document provides a cheat sheet for CSS Level 3 selectors, listing different types of selectors such as universal, type, attribute, structural pseudo-class, and combinator selectors. It also shows browser support for each selector and includes links to specifications and test suites.

Uploaded by

Wy Teay
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views

css3 Selectors Cheatsheet PDF

This document provides a cheat sheet for CSS Level 3 selectors, listing different types of selectors such as universal, type, attribute, structural pseudo-class, and combinator selectors. It also shows browser support for each selector and includes links to specifications and test suites.

Uploaded by

Wy Teay
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CSS Level 3 Selectors Cheat Sheet

Universal selector
*{}

Type selector
E{ }

Attribute selectors
E[foo] { } E[foo^="bar"] { } E[hreflang|="en"] { } E[foo="bar"] { } E[foo$="bar"] { } E[lang|="en"] { } E[foo~="bar"] { } E[foo*="bar"] { }

Internet Explorer 7 Internet Explorer 6 Firefox 2 Opera 9 Safari 2 * E E[foo] E[foo="bar"] E[foo~="bar"] E[foo^="bar"]

WWW WATCH http://hyper-text.org/

Structural pseudo-classes
E:root { } E:nth-of-type(n) { } E:last-child { } E:only-child { } E:nth-child(n) { } E:nth-last-of-type(n) { } E:first-of-type { } E:only-of-type { } E:nth-last-child(n) { } E:first-child { } E:last-of-type { } E:empty { }

E[foo$="bar"] E[foo*="bar"] E[hreflang|="en"] E[lang|="en"] E:root E:nth-child(n) E:nth-last-child(n) E:nth-of-type(n) E:nth-last-of-type(n) E:first-child

Structural pseudo-classes
E:link { } E:visited { }

The user action pseudo-classes


E:active { } E:hover { } E:focus { }

The target pseudo-class


E:target { }

The :lang() pseudo-class


E:lang(fr) { }

E:last-child E:first-of-type E:last-of-type

The UI element states pseudo-classes


E:enabled { } E:disabled { } E:checked { }

E:only-child E:only-of-type E:empty

The ::first-line pseudo-element


E::first-line { }

The ::first-letter pseudo-element


E::first-letter { }

E:link E:visited E:active E:hover E:focus E:target

The UI element fragments pseudo-elements


E::selection { }

The ::before pseudo-element


E::before { }

The ::after pseudo-element


E::after { }

E:lang(fr) E:enabled E:disabled E:checked

Class selectors
E.warning { }

ID selectors
E#myid { }

E::first-line E::first-letter E::selection

Negation pseudo-class
E:not(s) { }

Descendant combinator
EF{ }

E::before E::after E.warning

Child combinator
E>F{ }

Adjacent sibling combinator


E+F{ }

E#myid E:not(s) EF E>F E+F E~F

General sibling combinator


E~F{ }

supported
CSS Level 3 Selectors WWW WATCH http://www.w3.org/TR/css3-selectors http://hyper-text.org/archives/2007/01/css3_selector_cheatsheet.shtml

supported but buggy unsupported


last update 2007-01-20

CSS Selectors testsuite http://www.css3.info/selectors-test/

You might also like