htmlfonts
← Back to Guides Directory
Relative Sizing

REM vs EM: Which CSS Unit is Best?

01. The Concept

EMs compound based on their parent elements, which can lead to unpredictable sizes. REMs always scale relative to the root HTML element.

02. Production-Ready Code

padding: 2rem; font-size: 1.125rem;

💡 Pro Typography Tip

Set your browser default to 100% and use REMs for all your typography sizing.