HTML and CSS Reference
Table 5-1. Absolute CSS Units
1 point is equal to 1/72 inch.
1 pica is equal to 12 points.
1 pixel is a dot on the screen.
Font-relative lengths can be expressed in em , ex , and in CSS3 also in ch or rem (Table 5-2 ).
Table 5-2. Font-Relative CSS Units
1 em is equal to the current font size, which can be used to automatically adapt the font size
proportions to the font size chosen by the user in the browser. The em unit defines the proportion
of the width and height of a given letter with respect to the point size of a given font. This unit
originates in typography.
1 ex is the x-height of a font (approximately half the font size).
The used advance measure of the 0 glyph (ZERO, U+0030) of the font used to render the text.
The computed value of font-size on the root element.
In CSS3, lengths can also be expressed relative to the viewport size (Table 5-3 ), which is very useful in
mobile-friendly website design.
Table 5-3. Viewport-Relative CSS3 Units
1% of the width of the initial containing block.
1% of the height of the initial containing block.
The smallest vw and vh .
The largest vw or vh .
In spite of this variety, only three of these units are used most of the time: % , em , and px .