Tag Archives: CSS

Selector Index supported in different levels of CSS

Selector Index supported in different levels of css as per w3

PatternMeaningDescribed in sectionCSS1CSS2CSS3
*any elementUniversal selectorNoYesYes
Ean element of type EType
selector
YesYesYes
E[foo]an E element with a "foo" attributeAttribute selectorsNoYesYes
E[foo="bar"]an E element whose "foo" attribute value is exactly equal to "bar"Attribute
selectors
NoYesYes
E[foo~="bar"]an E element whose "foo" attribute value is a list of
whitespace-separated values, one of which is exactly equal to "bar"
Attribute
selectors
NoYesYes
E[foo^="bar"]an E element whose "foo" attribute value begins exactly with the
string "bar"
Attribute
selectors
NoNoYes
E[foo$="bar"]an E element whose "foo" attribute value ends exactly with the
string "bar"
Attribute
selectors
NoNoYes
E[foo*="bar"]an E element whose "foo" attribute value contains the substring
"bar"
Attribute
selectors
NoNoYes
E[foo|="en"]an E element whose "foo" attribute has a hyphen-separated list of
values beginning (from the left) with "en"
Attribute
selectors
NoYesYes
E:rootan E element, root of the documentStructural
pseudo-classes
NoNoYes
E:nth-child(n)an E element, the n-th child of its parentStructural
pseudo-classes
NoNoYes
E:nth-last-child(n)an E element, the n-th child of its parent, counting from the last
one
Structural
pseudo-classes
NoNoYes
E:nth-of-type(n)an E element, the n-th sibling of its typeStructural
pseudo-classes
NoNoYes
E:nth-last-of-type(n)an E element, the n-th sibling of its type, counting from the last
one
Structural
pseudo-classes
NoNoYes
E:first-childan E element, first child of its parentStructural
pseudo-classes
NoYesYes
E:last-childan E element, last child of its parentStructural
pseudo-classes
NoNoYes
E:first-of-typean E element, first sibling of its typeStructural
pseudo-classes
NoNoYes
E:last-of-typean E element, last sibling of its typeStructural
pseudo-classes
NoNoYes
E:only-childan E element, only child of its parentStructural
pseudo-classes
NoNoYes
E:only-of-type
an E element, only sibling of its typeStructural
pseudo-classes
NoNoYes
E:emptyan E element that has no children (including text nodes)Structural
pseudo-classes
NoNoYes
E:link

E:visited
an E element being the source anchor of a hyperlink of which the
target is not yet visited (:link) or already visited (:visited)
The link
pseudo-classes
YesYesYes
E:activean E element during certain user actionsThe user
action pseudo-classes
YesYesYes
E:hover

E:focus
an E element during certain user actionsThe user
action pseudo-classes
NoYesYes
E:targetan E element being the target of the referring URIThe
target pseudo-class
NoNoYes
E:lang(fr)an element of type E in language "fr" (the document language
specifies how language is determined)
The
:lang() pseudo-class
NoYesYes
E:enabled

E:disabled
a user interface element E which is enabled or disabledThe UI
element states pseudo-classes
NoNoYes
E:checkeda user interface element E which is checked
(for instance a radio-button or checkbox)
The UI
element states pseudo-classes
NoNoYes
E::first-linethe first formatted line of an E elementThe
::first-line pseudo-element
YesYesYes
E::first-letterthe first formatted letter of an E elementThe
::first-letter pseudo-element
YesYesYes
E::beforegenerated content before an E elementThe
::before pseudo-element
NoYesYes
E::aftergenerated content after an E elementThe
::after pseudo-element
NoYesYes
E.warningan E element whose class is "warning" (the document language
specifies how class is determined).
Class
selectors
YesYesYes
E#myidan E element with ID equal to "myid".ID
selectors
YesYesYes
E:not(s)an E element that does not match simple selector sNegation
pseudo-class
NoNoYes
E Fan F element descendant of an E elementDescendant
combinator
YesYesYes
E > Fan F element child of an E elementChild
combinator
NoYesYes
E + Fan F element immediately preceded by an E elementAdjacent sibling combinatorNoYesYes
E ~ Fan F element preceded by an E elementGeneral
sibling combinator
NoNoYes

Reference from W3.org