These charts compare basic support for the various selectors, pseudo-classes and pseudo-elements defined in the CSS Selectors module. When a selector is flagged as supported, this only means: the UA reacts to the selector in a way that is compatible with the specifications (rephrased: take these results with the proverbial grain of salt). I've followed the selector notation and grouping used by the W3C document.
The links in the first column (selectors) point to simple test cases in this section (when available). The links in the version column point to the first occurence of the selector in the specifications: CSS1, CSS 2.1 (CSS 2.0 selectors is not much different) and the already mentioned CSS 3. Test-suites used to compile these tables: the CSS 2.1 test suite, the CSS 3 selectors test suite (and see R. Blaut’s table), my own tests, Daniel Glazman’s css3 selectors test (John Resig’s alternative test, using queryselectors) and the test suite from CSS3.info.
See also the detailed overview by David Hammond at nanobox (recent browser versions only). Codebitch e.a. compiled a similar chart some years ago. There is also a chart a Wikipedia and a historical overview of selector support in Gecko based browsers
| OK | Supported |
| N | Not Supported |
| B | Buggy: not implemented according to the specs, may cause problems |
| P | Only partly implemented. |
| D | Destroyed: serious bugs in the implementation |
| - | not tested (yet) |
| S | Supported – not extensively tested… |
| version | Gecko 1.7~1.9 [2] | Opera 7.5~8.5 | Opera 9~10 | Safari 1.0~4.0.x | iCab 3.0 [1] | IE 8.0 Win | IE 7.0 Win | IE 5.5-6.0 Win | IE 5.23 Mac | Konq 3.5 [1] | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| version | Gecko 1.7~1.9 [2] | Opera 7.5~8.5 | Opera 9~10 | Safari 1.0~4.0.x | iCab 3.0 [1] | IE 8.0 Win | IE 7.0 Win | IE 5.5-6.0 Win | IE 5.23 Mac | Konq 3.5 [1] | |
| * | CSS 2 | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
| E | CSS 1 | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
| E F | CSS 1 | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
| E, F (grouping) [18] | CSS 1 | OK | OK | OK | OK | OK | OK | OK | OK | B [19] | OK |
| E > F | CSS 2 | OK | OK | OK | OK | OK | OK | OK | N | OK | OK |
| E + F | CSS 2 | OK | OK | OK | OK | OK | OK | B [23] | N | OK | OK |
| E ~ F | CSS 3 | OK | N | OK | P [3] | OK | OK | OK | N | OK | OK |
| E[foo] | CSS 2 | OK | OK | OK | OK | OK | OK | S | N | N | OK |
| E[foo="bar"] | CSS 2 | OK | OK | OK | OK | OK | OK | S | N | N | OK |
| E[foo~="bar"] | CSS 2 | OK | OK | OK | OK | OK | OK | S | N | N | OK |
| E[foo^="bar"] | CSS 3 | OK | N | OK | OK | OK | OK | S | N | N | OK |
| E[foo$="bar"] | CSS 3 | OK | N | OK | OK | OK | OK | S | N | N | OK |
| E[foo*="bar"] | CSS 3 | OK | N | OK | OK | OK | OK | S | N | N | OK |
| E[hreflang|="en"] | CSS 2 | OK | OK | OK | OK | OK | S | S | N | N | OK |
| E.class | CSS 1 | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
| E#id | CSS 1 | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
| E#id.class | CSS 2 | OK | OK | OK | OK | OK | OK | B | B | B | OK |
| E:not(s) | CSS 3 | OK | N | OK [28] | OK | N | N | N | N | N | OK |
| version | Gecko 1.7~1.9 | Opera 7.5~8.5 | Opera 9~10 | Safari 1.0~4.0.x | iCab 3.0 | IE 8.0 Win | IE 7.0 Win | IE 5.5-6.0 Win | IE 5.23 Mac | Konq 3.5 | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| version | Gecko 1.7~1.9 | Opera 7.5~8.5 | Opera 9~10 | Safari 1.0~4.0.x | iCab 3.0 | IE 8.0 Win | IE 7.0 Win | IE 5.5-6.0 Win | IE 5.23 Mac | Konq 3.5 | |
| E::first-line | CSS 1 [17] | OK | B [4] | B [4] | OK [27] | OK | OK [25] | B [4] [25] | B [4][5] | B [4] [6] | OK |
| E::first-letter | CSS 1 [17] | OK | OK | OK | OK | OK | OK [25] | B [24] [25] | B [5][24] | OK | OK |
| E::selection | CSS 3 [26] | N | N | OK | OK | N | N | N | N | N | OK |
| E::before | CSS 2 | OK | OK | OK | OK | OK | OK [25] | N | N | N | OK |
| E::after | CSS 2 | OK | OK | OK | OK | OK | OK [25] | N | N | N | OK |
| version | Gecko 1.7~1.9.0 | Gecko 1.9.1 | Opera 7.5~9.1 | Opera 9.5~10 | Safari 1.0~1.2 | Safari 1.3-2.0x | Safari 3.0 | Safari 3.2~4.0.x | iCab 3.0 | IE 8.0 Win | IE 7.0 Win | IE 5.5-6.0 Win | IE 5.23 Mac | Konq 3.5 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| version | Gecko 1.7~1.9.0 | Gecko 1.9.1 | Opera 7.5~9.1 | Opera 9.5~10 | Safari 1.0~1.2 | Safari 1.3-2.0x | Safari 3.0 | Safari 3.2~4.0.x | iCab 3.0 | IE 8.0 Win | IE 7.0 Win | IE 5.5-6.0 Win | IE 5.23 Mac | Konq 3.5 | |
| E:link | CSS 1 | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
| E:visited | CSS 1 | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK |
| E:active | CSS 1 | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | B [8] | B [8] | OK | OK |
| E:hover | CSS 2 | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | S | P [9] | P [9] | OK |
| E:focus | CSS 2 | OK | OK | P [10] | P [10] | OK | OK | OK | OK | OK | S | N [8] | N [8] | OK | OK |
| E:root | CSS 3 | OK | OK | N | OK | OK | OK | OK | OK | N | N | N | N | OK | OK |
| E:target | CSS 3 | OK | OK | N | OK | OK | OK | OK | OK | N | N | N | N | N | OK |
| E:lang() | CSS 2 | OK | OK | OK | OK | N | N | - | OK | OK | S | N | N | OK | OK |
| E:enabled | CSS 3 | P [21] | OK | P [7] | OK | N | N | OK | OK | N | N | N | N | P | OK |
| E:disabled | CSS 3 | P [21] | OK | P [7] | OK | N | N | OK | OK | N | N | N | N | P | OK |
| E:checked | CSS 3 | OK | OK | P [7] | OK | N | N | OK | OK | N | N | N | N | P | OK |
| E:nth-child(n) | CSS 3 | N | OK | N | OK | N | N | N | OK | N | N | N | N | N | OK |
| E:nth-last-child(n) | CSS 3 | N | OK | N | OK [28] | N | N | N | OK | N | N | N | N | N | OK |
| E:nth-of-type(n) | CSS 3 | N | OK | N | OK | N | N | N | OK | N | N | N | N | N | - |
| E:nth-last-of-type(n) | CSS 3 | N | OK | N | OK [28] | N | N | N | OK | N | N | N | N | N | - |
| E:first-child | CSS 2 | OK | OK | OK | OK | OK | OK | OK | OK | OK | OK | B [11] [23] | B [11] [23] | OK | OK |
| E:last-child | CSS 3 | OK | OK | N | OK | OK | D [12] | N | OK | N | N | N | N | N | OK |
| E:first-of-type | CSS 3 | N | OK | N | OK | N | N | N | OK | N | N | N | N | N | OK |
| E:last-of-type | CSS 3 | N | OK | N | OK | N | N | N | OK | N | N | N | N | N | OK |
| E:only-child | CSS 3 | P [21] | OK | N | OK | OK | D [12] | N | OK | N | N | N | N | N | OK |
| E:only-of-type | CSS 3 | N | OK | N | OK | N | D [12] | N | OK | N | N | N | N | N | OK |
| E:empty | CSS 3 | OK | OK | N | OK | B [22] | B [22] | B [22] | OK | N | N | N | N | N | OK |
| version | Gecko 1.0~1.9 | Opera 7.5~8.5 | Opera 9~10 | Safari 1.0~1.2 | Safari 1.3~4.0.x | iCab 3.0 | IE 8.0 Win | IE 7.0 Win | IE 5.5-6.0 Win | IE 5.23 Mac | Konq 3.5 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| version | Gecko 1.0~1.9 | Opera 7.5~8.5 | Opera 9~10 | Safari 1.0~1.2 | Safari 1.3~4.0.x | iCab 3.0 | IE 8.0 Win | IE 7.0 Win | IE 5.5-6.0 Win | IE 5.23 Mac | Konq 3.5 | |
| ns|E [15] | CSS 3 | OK | B [14] | OK | N | OK | OK | N | N | N | N | B [20] |
| *|E | CSS 3 | OK | B [16] | OK | N | OK | OK | N | N | N | B [16] | B [20] |
| *|* | CSS 3 | OK | B [16] | OK | N | OK | OK | N | N | N | B [16] | B [20] |
+, ~)E ~ F support was added for Safari 3.0application/xhml+xml, lots of bugs with inheritance; Opera 9 fixes some of them, but not all. More bugfixes came with the release of Opera 9.1:first-letter. IE 5-7 Windows and IE Mac treat ::first-line as a sort of block-level element.:: notation, it is not clear if this is by design.: notation only.:active treated as :focus.<a> element. Note also: IE Win, does not support the chaining of various pseudo-classes (a:link:hover or a:hover:visited); only the last pesudo-class in the chain is used.:last-child this is a regression in Safari 1.3+ and 2.0+ as it works correctly in Safari 1.0 ~ 1.2.x (in the css testsuite; my test page here works correctly, but the pseudo-class is applied to a block level element, and other selectors may override the :last-child). The has partly been fixed in recent nightly WebKit builds (dd 2006-01-11, but see bug 9840 and some related bugs in WebKits Bugzilla database).xhtml|E.: notation. ~) that is not supported by the UA, it must ignore the whole group. See demo file for some details.application/xhtml+xml in general). Both my tests and all the the namespace tests in the W3C testsuite give very conflicting results. Some selectors are applied when they should not be, some are ignored.:).::selection will be dropped out of CSS 3 selectors module, due to poor UI–concepts and lack of clarity on how it should work.text-transform" attribute in "first-line" CSS rulesback to introduction
Last modified: February 10 2010 14:30:02 GMT.