CSS units

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
em Relative to font size of the element
rem Relative to font size of root element
vw Relative to width of viewport
vh Relative to height of viewport
vmin Relative to viewport smaller dimesion
vmax Relative to viewport larger dimension 
 
© 2016 - 2022, All Rights are Reserved.