← Cheat Sheets
CSS Units Cheat Sheet
Absolute and relative units.
# CSS Units Cheat Sheet
Absolute and relative units.
| Unit | Meaning |
|---|---|
| `px` | CSS pixel (1/96 in) |
| `rem` | Root font size (usually 16px) |
| `em` | Parent (or own for font-size) font size |
| `%` | Percentage of the parent |
| `vw` `vh` | 1% of viewport width / height |
| `vmin` `vmax` | Smaller / larger viewport dimension |
| `dvh` | Dynamic viewport height (mobile browser bars) |
| `ch` | Width of the "0" glyph |
| `fr` | Fraction of free space in Grid |
| `cm` `mm` `in` | Physical lengths (1in = 2.54cm = 96px) |
| `pt` | 1/72 inch |
Use `rem` for font sizes and spacing, `%` or `fr` for layout.