# CSS Units

Measurements and positions in CSS properties are indicated in length units. Most browsers support four types of length units: absolute, relative, angle, and time.

Absolute units specify an exact measurement. Relative units specify a length in relation to another property.

The following table lists the CSS units:

Relative Length Units
em | The computed font-size
ex | The height of a lowercase "x"
px | Pixels, relative to the viewing device
% | Percentage
rem | The font size of the root element
vw | The viewport width
vh | The viewport height
vm | The smaller value of viewport width or height
ch | Zero-width (width of the zero glyph in the rendering font)
Absolute Length Units
in | Inches (1 inch = 2.54 centimeters)
cm | Centimeters
mm | Millimeters
pt | Points (1 point = 1/72 inches)
pc | Picas (1 pica = 12 points)
Angle Units
deg | Degrees
grad | Gradians
rad | Radians
turn | Turns
Time Units
ms | Milliseconds
s | Seconds

The `em` unit is relative to the calculated value of the `font-size` attribute of the element.

The `px` unit is relative to the resolution of the viewing device.

The `%` unit is relative to another value (eg. a length).