FiFont
← Typography reference

Typography reference

The em and rem units

An em is relative to font size in its relevant context; rem is relative to the root element's font size. Nested em values can compound.

Try the visual comparison

The first font-size is 1em, relative to its parent's computed size; the second is 1.5rem, relative to the root. These may coincide under some settings.

Example A

Scalable typography
font-size:1em;

Example B

Scalable typography
font-size:1.5rem;

These examples use browser/system fonts unless explicitly noted. Actual rendering and font feature support vary with your environment.

What to check in your project

Set a 16px root and a 20px parent in a scratch layout: 1em resolves to 20px and 1.5rem to 24px. Change root size and inspect the computed results and wrapping.

Explore the related tool or guide →

Continue exploring