Tuesday, 31 July 2012

Previous Interview Question Next Interview Question
Home

CSS3 Selectors


*any element
Ean element of type E
E[foo]an E element with a “foo” attribute
E[foo=”bar”]an E element whose “foo” attribute value is exactly equal to “bar”
E[foo~=”bar”]an E element whose “foo” attribute value is a list of space-separated values, one of which is exactly equal to “bar”
E[foo^=”bar”]an E element whose “foo” attribute value begins exactly with the string “bar”
E[foo$=”bar”]an E element whose “foo” attribute value ends exactly with the string “bar”
E[foo*=”bar”]an E element whose “foo” attribute value contains the substring “bar”
E[hreflang|=”en”]an E element whose “hreflang” attribute has a hyphen-separated list of values beginning (from the left) with “en”
E:rootan E element, root of the document
E:nth-child(n)an E element, the n-th child of its parent
E:nth-last-child(n)an E element, the n-th child of its parent, counting from the last one
E:nth-of-type(n)an E element, the n-th sibling of its type
E:nth-last-of-type(n)an E element, the n-th sibling of its type, counting from the last one
E:first-childan E element, first child of its parent
E:last-childan E element, last child of its parent
E:first-of-typean E element, first sibling of its type
E:last-of-typean E element, last sibling of its type
E:only-childan E element, only child of its parent
E:only-of-typean E element, only sibling of its type
E:emptyan E element that has no children (including text nodes)
E:link
E:visitedan E element being the source anchor of a hyperlink of which the target is not yet visited (:link) or already visited (:visited)
E:active
E:hover
E:focusan E element during certain user actions
E:targetan E element being the target of the referring URI
E:lang(fr)an element of type E in language “fr” (the document language specifies how language is determined)
E:enabled
E:disableda user interface element E which is enabled or disabled
E:checkeda user interface element E which is checked (for instance a radio-button or checkbox)
E::first-linethe first formatted line of an E element
E::first-letterthe first formatted letter of an E element
E::selectionthe portion of an E element that is currently selected/highlighted by the user
E::beforegenerated content before an E element
E::aftergenerated content after an E element
E.warningan E element whose class is “warning” (the document language specifies how class is determined).
E#myidan E element with ID equal to “myid”.
E:not(s)an E element that does not match simple selector s
E Fan F element descendant of an E element
E > Fan F element child of an E element
E + Fan F element immediately preceded by an E element
E ~ Fan F element preceded by an E element

Previous Interview Question Next Interview Question
Home

0 comments :

Post a Comment