Last major update on 18 July 2010.
See the CSS Selector Test for tests of and information about CSS3 selectors.
Earlier versions of this page has been translated into Brazilian Portuguese and Romanian.
The contents of my CSS pages and browser compatibility.
| Quirks and Strict mode | How to trigger them, what the differences are. Contains compatibility table. |
| CSS Hacks | Be very, very careful. |
| Conditional comments | A generally reliable method for separating IE from all other browsers. |
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Selects all elements | Yes | Yes | Yes | Yes | Yes | To be tested | |||||||||||||
| Selects an element that is a child of another element | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| Selects an element that is a next sibling of another element | No | Static | Almost | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||
|
|||||||||||||||||||
| Selects an element with a certain attribute | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| Whether an element can support two or more class names | Buggy | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
|
|||||||||||||||||||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
| To generate content before and after an element | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| An element in a hovered (mouseover) or active (mousedown) state. | Minimal | Incom |
Yes | Yes | Yes | Yes | Yes | To be tested | |||||||||||
|
|||||||||||||||||||
| An element that is the first child of its parent | No | Static | Almost | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||
|
|||||||||||||||||||
| The first line or first letter of an element | Yes | Yes | Almost | Almost | Almost | To be tested | |||||||||||||
|
|||||||||||||||||||
| Form fields that receive user focus | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
|
|
|||||||||||||||||||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
for :before/:after
|
No | Yes | Yes | Almost | Almost | Almost | To be tested | ||||||||||||
|
|||||||||||||||||||
| No | Yes | Yes | Yes | Yes | Yes | To be tested | |||||||||||||
To assign counters to headings or other elements. |
|||||||||||||||||||
| Change cursor style | Yes | Yes | Yes | Yes | Yes | To be tested | |||||||||||||
Microsoft values don’t count for overall browser compatibility. |
|||||||||||||||||||
| Incom |
Yes | Almost | Almost | Yes | Yes | Yes | To be tested | ||||||||||||
Incomplete: lacks 2 or more values; almost: lacks 1 value. |
|||||||||||||||||||
| Types, image, position | Incom |
Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
IE7- doesn’t support a few types. The test page also contains CSS 3 values. |
|||||||||||||||||||
| No | Minimal | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
|
|||||||||||||||||||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
| A sort of border, but it doesn’t count for the box model. | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| Incor |
Yes | Yes | Yes | Yes | Yes | To be tested | |||||||||||||
|
|||||||||||||||||||
| Incom |
Almost | Yes | Yes | Almost | Yes | Almost | Yes | To be tested | |||||||||||
IE 5/6 don’t support position: fixed
|
|||||||||||||||||||
| Incom |
Yes | Yes | Almost | Almost | Almost | Yes | To be tested | ||||||||||||
See page for details. |
|||||||||||||||||||
empty-cells,
border-collapse,
border-spacing,
table-layout,
caption-side
|
Incom |
Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
See page for detailed compatibility. |
|||||||||||||||||||
| To remove text wrapping or to make an element behave like a pre | Incom |
Yes | Incom |
Incom |
Yes | Yes | Yes | Yes | To be tested | ||||||||||
See page for detailed compatibility. IE9 has one bug. |
|||||||||||||||||||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Selects an element that is a general next sibling of another element | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| Selects an element with an attribute whose value starts with, ends with, or contains a certain string. | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| Empty elements | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| For enabled, disabled, or checked form fields. | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| The first element of its type. | No | Yes | ? | Yes | Yes | Yes | Yes | To be tested | |||||||||||
| An element that is the last child of its parent | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| The last element of its type. | No | Yes | ? | Yes | Yes | Yes | Yes | To be tested | |||||||||||
| Negation of a selector | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
| Select elements according to a formula | No | Yes | No | Yes | Yes | Yes | Incor |
To be tested | |||||||||||
|
|||||||||||||||||||
| No | Yes | ? | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| No | Yes | ? | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| Select elements according to a formula | No | Yes | No | Yes | Yes | Yes | Incor |
To be tested | |||||||||||
|
|||||||||||||||||||
| An element that is the only child of its parent | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| The only element of its type. | No | Yes | ? | Yes | Yes | Yes | Yes | To be tested | |||||||||||
| The root element, or initial containing block. | No | Yes | Yes | Yes | Yes | Yes | To be tested | ||||||||||||
| Text selected by the user. | No | Yes | -moz- | Yes | Yes | Yes | To be tested | ||||||||||||
Element that is a target of a hash (page.html#testHash)
|
No | Yes | Yes | Yes | Yes | Incom |
To be tested | ||||||||||||
|
|||||||||||||||||||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| States whether the background image scrolls with the document, the element, or not at all. | Incor |
Incom |
Yes | Incom |
Incom |
Yes | Yes | Incom |
Yes | To be tested | |||||||||
local.scroll means local. |
|||||||||||||||||||
| States whether the background covers the border-box (default), padding-box or content-box. | No | Yes | No | Yes | -webkit- | -webkit- | No | Buggy | Almost | To be tested | |||||||||
|
|||||||||||||||||||
| States whether the background originates in the border-box, padding-box (default) or content-box. | No | Yes | No | Yes | -webkit- | Yes | Yes | -o- | Yes | To be tested | |||||||||
States how the background is repeated. Note the new values space and
round.
|
Incom |
Yes | Incom |
Incom |
Incor |
Incor |
Incom |
Yes | To be tested | ||||||||||
space and round.space and round as no-repeat. |
|||||||||||||||||||
| States the size of the background image, in pixels, percents, or with two special values. | No | Yes | No | -moz- | Yes | Incom |
Yes | Yes | Incom |
Yes | To be tested | ||||||||
contain and cover and requires a vendor prefix. |
|||||||||||||||||||
| How to define more than one background image on an element | No | Yes | No | Yes | Yes | Yes | Yes | To be tested | |||||||||||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
| No | Yes | ? | -moz- | -webkit- | Yes | Yes | No | Yes | To be tested | ||||||||||
| No | Yes | ? | -moz- | -webkit- | -webkit- | No | Yes | To be tested | |||||||||||
| No | Yes | -moz- | -webkit- | -webkit- | Yes | To be tested | |||||||||||||
|
No browser supports |
|||||||||||||||||||
| To divide one block of text into several columns, newspaper-style. | No | -moz- | -webkit- | -webkit- | No | To be tested | |||||||||||||
| No | filter | No | No | -moz- | -webkit- | -webkit- | No | To be tested | |||||||||||
| filter | Yes | Yes | Yes | Yes | Yes | To be tested | |||||||||||||
| Allow the user to resize an element. | No | No | Yes | Yes | No | To be tested | |||||||||||||
|
The element’s size can only be increased. |
|||||||||||||||||||
| Shows ellipsis characters when a text flows outside its box. | No | Yes | No | Yes | Yes | -o- | Yes | To be tested | |||||||||||
This property only makes sense when a box has
|
|||||||||||||||||||
| Create a text-shadow. | No | Yes | Yes | Yes | Yes | To be tested | |||||||||||||
| No | No | -webkit- | Buggy | No | To be tested | ||||||||||||||
|
|||||||||||||||||||
| Selector | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 pr3 | FF 3.0 | FF 3.5 | FF 3.6 | FF 4b1 | Saf 4.0 Win | Saf 5.0 Win | Chrome 4 | Chrome 5 | Opera 10.10 | Opera 10.53 | Opera 10.60 | Konqueror 4.x | ||
These test pages don’t quite fit in the table above, or their browser compatibility is too slight:
clear: both.