CSS Pixels, %, em, rem — a practical guide to CSS px % em rem with clear examples you can reuse in real projects.
CSS Tutorial Series (24/109). Prefer one article? Read the complete CSS tutorial.
Short description
Many teams prefer rem for type/spacing scale consistency.
em vs rem
html { font-size: 100%; }
.card { font-size: 1rem; padding: 1.25rem; }
.card small { font-size: 0.875em; }