Measurements and positions in CSS properties are indicated in length units. Relative units specify a length in relation to another property, and scale better from one output device to another (such as from a monitor to a printer) and in comparison to other page elements. Absolute units specify an exact measurement, such as inches or centimeters, and are useful when you know the physical properties of the output device.
Relative length units
A fluid measurement based on the percentage of space within a given container
A fluid measurement of space in relation to the computed font-size of the parent container
Font size of the root element (not dependent on the font-size of it's parent container)
The viewport width (equal to 1% of the width of the initial containing block)
The viewport height (equal to 1% of the height of the initial containing block)
The smaller (minimum) value of viewport width or height
The larger (maximum) value of viewport width or height
The height of a lowercase "x" in a font.
Zero-width, width of the zero glyph in the rendering font (Unicode character U+0030)
In a @page at-rule declaration block, the use of the viewport lengths are invalid and the declaration will be dropped.
Absolute length units
Pixels, relative to the viewing device, a non-fluid unit of measurement (1/96th of a physical inch)
Inches (1in = 2.54cm = 96px)
Millimeters (1/10th of 1cm)
Points (1pt = 1/72 inches)
Picas (1pc = 12pt)
Relative and absolute font sizes
Setting the font size may change the size of other items, since it is used to compute values such as em and ex length units.
Absolute font sizes
Relative font sizes
Global font sizes
The feedback system for this content will be changing soon. Old comments will not be carried over. If content within a comment thread is important to you, please save a copy. For more information on the upcoming change, we invite you to read our blog post.