Back to the index.
CSS2 selectors | CSS3 selectors | CSS3 UI selectors | CSS4 selectors
Here are almost all CSS2 and 3 selectors, and the CSS3 UI selectors (mostly structural pseudo-classes).
This is the desktop table. See also the mobile table.
Last major update on 2 October 2013.
I'm writing a CSS book.
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux | |
p
|
Yes | Yes | Yes | Yes | Yes | ||||||||||||||
p.test
|
Yes | Yes | Yes | Yes | Yes | ||||||||||||||
p#test
|
Yes | Yes | Yes | Yes | Yes | ||||||||||||||
p span
|
Yes | Yes | Yes | Yes | Yes | ||||||||||||||
Selects all elements | Yes | Yes | Yes | Yes | Yes | ||||||||||||||
Two or more class names | Buggy | Yes | Yes | Yes | Yes | Yes | |||||||||||||
|
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux | |
Selects an element that is a child of another element | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Selects an element that is a next sibling of another element | No | Static | Yes | Yes | Yes | Yes | Yes | ||||||||||||
|
|||||||||||||||||||
Selects an element that is a general next sibling of another element | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux | |
Selects an element with a certain attribute | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Selects an element with a certain attribute value | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Selects an element with an attribute that includes a certain value; space-separated | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Selects an element with a certain attribute that starts with a certain value | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Selects an element with a certain attribute that ends with a certain value | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Selects an element with a certain attribute that contains a certain value; not necessarily space-separated | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Attribute value starts with "value" or "value-" | Not tested | Yes | Yes | Yes | Yes | Yes | |||||||||||||
I did not test IE5-6, but assume they don’t support it. |
|||||||||||||||||||
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux |
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux | |
To generate content before and after an element | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
The first first letter of an element | Yes | Yes | Almost | Almost | Almost | ||||||||||||||
|
|||||||||||||||||||
The first line of an element | Yes | Yes | Yes | Yes | Yes | ||||||||||||||
Text selected by the user. | No | Yes | -moz- | Yes | Yes | Yes | |||||||||||||
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux | |
An element in an active state. | Incom |
Almost | Yes | Yes | Yes | Yes | |||||||||||||
|
|||||||||||||||||||
An element in a hovered state. | Incom |
Yes | Yes | Yes | Yes | Yes | |||||||||||||
|
|||||||||||||||||||
Unvisited link | Yes | Yes | Yes | Yes | Yes | ||||||||||||||
Negation of a selector | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Element that is a target of a hash (page.html#testHash )
|
No | Incom |
Yes | Yes | Yes | Yes | |||||||||||||
|
|||||||||||||||||||
Visited link | Security issue | Yes | Yes | Yes | Security issue | Yes | Yes | ||||||||||||
There’s a security issue with |
|||||||||||||||||||
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux |
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux | |
Empty elements | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
An element that is the first child of its parent | No | Static | Almost | Yes | Yes | Yes | Yes | Yes | |||||||||||
|
|||||||||||||||||||
The first element of its type. | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
An element that is the last child of its parent | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
The last element of its type. | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux | |
Select elements according to a formula | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
No | Yes | Yes | Yes | Yes | Yes | ||||||||||||||
No | Yes | Yes | Yes | Yes | Yes | ||||||||||||||
Select elements according to a formula | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
An element that is the only child of its parent | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
The only element of its type. | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
The root element, or initial containing block. | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux |
See also the CSS3 User Interface spec.
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux | |
Checked elements (checkboxes or radios) | No | Yes | Yes | No | Yes | Yes | Yes | ||||||||||||
Default choices in select boxes or groups of radio buttons | No | Yes | No | No | Incom |
No | No | ||||||||||||
Tested on radio buttons and select boxes.
|
|||||||||||||||||||
Disabled form fields | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Non-disabled form fields | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Form fields that have the keyboard focus | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Form fields with values that are in range (numbers) | No | No | Yes | Yes | Yes | ||||||||||||||
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux | |
Form field with value that does not conform to pattern
|
No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Non-required form fields | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Form fields with values that are not in range (numbers) | No | No | Yes | Yes | Yes | ||||||||||||||
Readonly form fields | No | No | Yes | Yes | Yes | ||||||||||||||
Non-readonly form fields | No | No | Yes | Yes | Yes | ||||||||||||||
Required form fields | No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Form field with value that conforms to pattern
|
No | Yes | Yes | Yes | Yes | Yes | |||||||||||||
Method or property | Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||||
5.5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 Win | 24 Mac | 24 Linux | 6 | 12 Win | 12 Mac | 12 Linux | 16 Win | 16 Mac | 30 Win | 30 Mac | 29 Linux |
Desktop browser test array 1.0.1; October 2013
Here are tests for selectors that aren’t supported yet:
p,h3
.I do not test the time-dimensional pseudo-classes (I don’t test with a speech browser), the :scope
pseudo-class (no syntax given), :indeterminate
(too complex; and I think the definition is wrong) or the column-related pseudo-classes (syntax in overview table and in spec itself differs), :dir
and :lang
.