1.0 Units of Measurement

HTML attributes and CSS property values (such as height, width and font-size for example) can be specified in one of two ways:

  • In absolute values
  • In relative values

Absolute values have a specific value that are fixed, allowing precise measurements, such as millimetres, inches, etc. Relative values have no fixed, specific value and are calculated in comparison to a current value. Because Web pages can be viewed across different browsers and platforms, it is wiser to use relative values.

Absolute Measurement
AbbreviationUnitDescription
inInches1in = 6pc
ptPoints1in = 72pt
picaspc1pc = 12pt
mmmillimetres1in = 25.4mm
cmcentimetres1cm = 10mm
Relative Measurement
AbbreviationUnitDescription
pxpixelsThere are typically between 72 and 90 pixels/inch
emem spaceAn em space is the width and height of the capital letter M base upon the current font and size
exx space1ex based on height of lowercase x (usually about half the font-size)
%PercentageDefines a measurement as a percentage relative to another value