CSS contents and browser compatibility

Last major update on 23 February 2012.

Mobile table.

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.

Want these Tables updated? Join the donation drive.

Table of Contents

How to trigger them, what the differences are. Contains compatibility table.
Be very, very careful.
A generally reliable method for separating IE from all other browsers.
without clear: both.

CSS 2.1 selectors

Specification.

Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac
Selects all elements Yes Yes Yes Yes Yes
 
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 Almost Yes Yes Yes Yes Yes
Static
The browser doesn’t correctly update the styles of the original element when another element is placed before it.
  • IE8 updates correctly, but only after you remove the focus from the test link.
Selects an element with a certain attribute No Yes Yes Yes Yes Yes
 
Whether an element can support two or more class names Buggy Yes Yes Yes Yes Yes
  • IE6 and lower make a mistake; when confronted with p.test.small they act as if the selector is p.small.
Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac
To generate content before and after an element No Yes Yes Yes Yes Yes
An element in a hovered (mouseover) or active (mousedown) state. Minimal Incomplete Almost Yes Yes Yes Yes
  • IE 5/6 supports both only on links. IE 7 supports :hover, but not :active, on all elements.
  • IE 8-10 (and maybe older ones, too) have a slight bug: clicking the mouse down on a nested element does not trigger :active. Try it in the test page by depressing the mouse button on one of the code examples. The :active styles do not kick in.
An element that is the first child of its parent No Static Almost Yes Yes Yes Yes Yes
Static
Browser doesn’t update the styles when elements are added dynamically.
  • IE8 does the right thing only after you remove the focus from the test link.
The first line or first letter of an element Yes Yes Almost Almost Almost
  • Safari, Chrome and Konqueror add an extra 'T' when you do the dynamic test.
  • Opera leaves out the 'T' of the second and subsequent sentences when you do the dynamic test.
Form fields that receive user focus No Yes Yes Yes Yes Yes
Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac

CSS 2.1 declarations

Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac
for :before/:after No Yes Yes Yes Yes Yes
No Yes Yes Yes Yes Yes

To assign counters to headings or other elements.

Change cursor style Incomplete Almost Yes Almost Yes Yes Almost Incomplete
  • IE5.5 and Opera Mac lack some values.
  • Safari Windows crashes on no-drop.
  • IE and Opera do not support .gif files as custom cursors. IE supports only .cur files; Opera not even that.
Incomplete Yes Almost Yes Yes Yes

Incomplete: lacks 2 or more values; almost: lacks 1 value.

Types, image, position Minimal Incomplete Incomplete Yes Yes Incomplete
Yes
Lacks at most one type
Almost
Lacks two to five types
Incomplete
Lacks six to twelve types
Minimal
Lacks thirteen or more types
No Minimal Yes Yes Yes Yes Yes
  • IE 6 supports min-height on TD’s only.
Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac
A sort of border, but it doesn’t count for the box model. No Yes Yes Yes Yes Yes
Incorrect Yes Yes Yes Yes Yes
  • IE 5/6 doesn’t implement overflow: visible correctly.
Incomplete Almost Yes Yes Almost Almost Yes

IE 5/6 don’t support position: fixed

  • IE7 has a strange bug; see page.
  • Safari and Chrome have a minor bug; see page.
Incomplete Yes Yes Almost Almost Yes
Almost
Browser doesn’t support visibility: collapse.
empty-cells, border-collapse, border-spacing, table-layout, caption-side Incomplete Yes Yes Yes Yes Yes

See page for detailed compatibility.

To remove text wrapping or to make an element behave like a pre Incomplete Yes Yes Yes Yes Yes

See page for detailed compatibility. IE9 has one bug.

Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac

CSS 3 selectors

Specifications.

Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac
Selects an element that is a general next sibling of another element No Yes Yes Yes Yes Yes
Selects an element with an attribute whose value starts with, ends with, or contains a certain string. No Yes Yes Yes Yes Yes
 
Empty elements No Yes Yes Yes Yes Yes
For enabled, disabled, or checked form fields. No 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
Negation of a selector No Yes Yes Yes Yes Yes
Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac
Select elements according to a formula No Yes Yes Yes Yes Incorrect
  • Opera gets totally confused in the dynamic test.
No Yes Yes Yes Yes Yes
No Yes Yes Yes Yes Yes
Select elements according to a formula No Yes Yes Yes Yes Incorrect
  • Opera gets totally confused in the dynamic test.
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
Text selected by the user. No Yes -moz- Yes Yes Yes
Element that is a target of a hash (page.html#testHash) No Incomplete Yes Yes Yes Yes
  • IE doesn’t react to the Back and Forward buttons: the element doesn’t apply or remove the pseudo-class at all. This used to be an Opera problem, while IE used to get it right.
Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac

CSS 3 declarations

Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac
Prefixed No Yes Yes Yes No
States whether the background image scrolls with the document, the element, or not at all. Incorrect Incomplete Yes Incomplete Yes Yes Yes
Incomplete
browser does not support local.
Incorrect
scroll means local.
States whether the background covers the border-box (default), padding-box or content-box. No Yes Yes Yes Yes Yes
States whether the background originates in the border-box, padding-box (default) or content-box. No Yes Yes Yes Yes Yes
States how the background is repeated. Note the new values space and round. Incomplete Yes Incomplete Incorrect Incorrect Yes
Incomplete
Browser does not support space and round.
Incorrect
Browser treats space and round as no-repeat.
States the size of the background image, in pixels, percents, or with two special values. No Yes Yes Yes Yes Yes
How to define more than one background image on an element No Yes Yes Yes Yes Yes
 
Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac
No Yes Yes Yes Yes Yes
No Yes Yes Yes Yes Yes
No Yes -moz- Yes Yes Yes
To divide one block of text into several columns, newspaper-style. No Yes -moz- -webkit- -webkit- Yes
How to define a layout Prefixed No Yes XUL No No No

-moz-grid is an old XUL property. As far as I can determine Mozilla is going to implement the spec eventually. See the table on this page.

filter Yes Yes Yes Yes Yes
Allow the user to resize an element. No Yes Yes Yes No

Firefox allows you to decrease the size of the element. In Chrome and Safari the element’s size can only be increased.

Shows ellipsis characters when a text flows outside its box. No Yes Yes Yes Yes Yes

This property only makes sense when a box has white-space: nowrap and an overflow other than visible.

Create a text-shadow. No Yes Yes Yes Yes
 
Prefixed No Almost Almost Almost Almost
  • Firefox doesn’t transition left and letter-spacing.
  • Safari and Chrome also apply all transitions when the user zooms. This should not happen.
  • Safari doesn’t transition text-shadow quite correctly.
  • Opera doesn’t transition background-position and has bugs in font-size and line-height.
Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac

CSS3 Units and Values

There are some pretty interesting units and values being proposed.

Selector or declaration IE 5.5 IE 6 IE 7 IE8 IE9 IE10 pr2 FF 11.0 Win FF 10.0.2 Mac Saf 5.1 Win Saf 5.1.2 Mac Chrome 18 Win Chrome 17 Mac Opera 11.61 Win Opera 11.61 Mac
To perform calculations in CSS Prefixed No Yes Yes No No No
vw, vh, and vm units; they mean hundreths of the viewport width and height No Yes No No No No

I wrote test cases for the following values and units, but they’re not supported by any browser yet.