CSS units of measure.

Specifying Length

Here are the units of measurement. The syntax has no space between the value and the unit of measure.

Type Unit Name Comment
Absolute mm Millimeter 10mm = 1cm. Floating-point value.
cm Centimeter 2.54cm = 1in. Floating-point value.
in Inch 1in = 25.4mm. Floating-point value.
pc Pica 6pc = 1in and 1pc = 12pt. Floating-point value.
pt Point 72pt = 1in. Floating-point value.
xx-small, x-small, small, medium, large, x-large, xx-large can signify font-size
Relative % Percent Relative to its normal size (100%). Integer value.
em Em 1em = point size of current font. Floating-point value.
ex Ex 1ex = height of lower case x of current font. Floating-point value.
larger, smaller can signify font-size
Device Dependent px Pixel 1px = smallest unit on the display screen. Floating-point value.

Here are rules of thumb for selecting the type of unit of measurement used when specifying a value for a property in a CSS Rule:

Specifying Color

There are five different schemes for specifying values for colors:

Specifying Other Values

Some properties require different values.

Page Modified: (Hand noted: 2004-02-20 22:40:16Z) (Auto noted: 2007-11-17 06:48:25Z)