CSS units and values

Back to the index.

CSS3 Unit and Values spec.

The contents of my CSS pages and browser compatibility.

This is the desktop table. See also the mobile table.

Last major update on 14 March 2013.

I'm writing a CSS book.

Font-dependent units

Selector IE7 IE8 IE9 IE10 FF 19 Win FF 19 Mac Safari 6.0.2 Mac Chrome 25 Win Chrome 25 Mac Yandex 1.5 Mac Opera 12.14 Win Opera 12.14 Mac
Width of the character “0” in the current font. No Yes Yes No No No
Equal to the font size in pixels Yes Yes Yes Yes Yes
Width of the “x” character OR equal to half an em Yes Yes Yes Yes Yes
Equal to the font size of the HTML element No Yes Yes Yes Yes Yes

Absolute units

Selector IE7 IE8 IE9 IE10 FF 19 Win FF 19 Mac Safari 6.0.2 Mac Chrome 25 Win Chrome 25 Mac Yandex 1.5 Mac Opera 12.14 Win Opera 12.14 Mac
1 in = 2.54 cm Yes Yes Yes Yes Yes
1 in = 96 px Yes Yes Yes Yes Yes
10 mm = 1 cm Yes Yes Yes Yes Yes
1 pc = 12 pt Yes Yes Yes Yes Yes
1 in = 72 pt Yes Yes Yes Yes Yes
ROOT UNIT Yes Yes Yes Yes Yes

Viewport units

Static: The browser correctly sizes the elements on page load, but does not update them when the page is resized.

Selector IE7 IE8 IE9 IE10 FF 19 Win FF 19 Mac Safari 6.0.2 Mac Chrome 25 Win Chrome 25 Mac Yandex 1.5 Mac Opera 12.14 Win Opera 12.14 Mac
Percentages of the viewport width No Yes Yes Static Static No
Percentages of the larger of viewport width or height No Yes No No No
Percentages of the smaller of viewport width or height No Yes Yes Static Static No
Selector IE7 IE8 IE9 IE10 FF 19 Win FF 19 Mac Safari 6.0.2 Mac Chrome 25 Win Chrome 25 Mac Yandex 1.5 Mac Opera 12.14 Win Opera 12.14 Mac

Values

Selector IE7 IE8 IE9 IE10 FF 19 Win FF 19 Mac Safari 6.0.2 Mac Chrome 25 Win Chrome 25 Mac Yandex 1.5 Mac Opera 12.14 Win Opera 12.14 Mac
To perform calculations in CSS No Yes Yes -webkit- -webkit- No

Not supported

These values are not supported in any browser.