CSS
June 3, 2026 1 min read

Understanding CSS Units: Absolute and Relative Units for Web Design

HS
HEMANT SINGH
Technical Writer & Educator

CSS units

  • Absolute unit
  • Relative unit

Absolute units

  1. mm : millimeters
  2. cm : centimeters
  3. in : inches = 96px = 2.54 cm
  4. px = 1/96th of 1 inch
  5. pt = 1/72 of 1 inch
  6. pc = 12 pt

Relative units

%Relative to parent element
emRelative to font size of the element
remRelative to font size of root element
vwRelative to width of viewport
vhRelative to height of viewport
vminRelative to viewport smaller dimesion
vmaxRelative to viewport larger dimension