1. If the value is 0, omit the unit.

2. Absolute and relative units:

  • Absolute units: cm, mm, in(inch), PX, pt, PC. For low DPI devices, 1px is one device pixel of the display, and for high DPI devices, 1px is multiple device pixels.

  • Relative unit:

  • Em. Size relative to the original font size.

  • Ex. X-height relative to the current font.

  • Ch: Width relative to “0” (zero).

  • Rem: font size relative to the root element.

  • Vw: 0.01 relative to the viewport width.

  • Vh: 0.01 relative to the height of the viewport.

  • Vmin: 1% of the smaller size of the viewport.

  • Vmax: 1% of the larger size relative to the viewport.

  • % : relative to the parent element.

  • Em and REM units can be used to create perfectly elastic layouts.