Guided Notes
Units & CSS Functions
Absolute and relative units, rem vs em, viewport units, calc(), min(), max(), and clamp().
Absolute and relative units
Slide 1 / 5Absolute units are fixed: px is the standard (cm, in, and pt are for print).
Relative units scale with something else:
| Unit | Relative to |
|---|---|
| % | The parent (for width) or the parent's font size |
| em | The element's own font size |
| rem | The root (<html>) font size β usually 16px |
| vw / vh | 1% of the viewport width / height |
| ch | The width of the "0" character |
