Skip to main content

What units of measurement can be used for font size?

For font-size, you can use relative and absolute units.

Relative:

  • em, relative to the parent's font size
  • rem, relative to the root element's font size (html)
  • %, a percentage of the parent's font size
  • vw, vh, a fraction of the browser window's width or height
  • vmin, vmax, a fraction of the window's smaller/larger side

Absolute:

  • px, pixels
  • pt, typographic points
  • pc, picas
  • in, inches
  • cm, centimeters
  • mm, millimeters

In practice, px, em, rem, and % are used most often.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.