rem unit

noun

say it: “REM YOO-nit” /rɛm ˈjunɪt/

A CSS unit of size equal to the root (html) element's font size, which is 16px in most browsers unless the reader changes it, so 1.5rem is usually 24px.

What is the rem unit?

A rem is the font size of the root <html> element (usually 16px). Unlike em, it doesn't change with nesting, and it respects the user's font settings.

h1 { font-size: 2rem; }      /* 32px by default */
.card { padding: 1.5rem; }   /* 24px */

In a sentence

  • “I sized every heading with the rem unit, so they grow when a reader picks a bigger text size in their browser.”

Level: Novice · More CSS terms at this level

Updated