LESSON 25 OF 100

Size text with rem

Use the appropriate unit for an adaptable value.

Official sourceW3C CSS Values — rem unitReviewed: 2026-08-26
STEP 1 · LEARN

How it works

rem is relative to the root element font size and gives a stable base for a type scale.

Correct example
.lead { font-size: 1.25rem; }

The unit describes how the value relates to its context.

Common mistake
.lead { font-size: 1.25; }

A non-zero value without a unit does not express the required length or proportion.

STEP 2 · APPLY

Your exercise

Complete the declaration with the requested value and unit.

STEP 3 · BUILD

Write and see the result

index.htmlCSS
Safe resultisolated
The draft stays only in this browser.HTML and CSS allowed · scripts and network blocked
STEP 4 · CHECK

What needs to pass

0%not checked
  • The declaration uses the requested value and unit.
  • The target element is present.
Explain the solution logic

The property, number and unit together form the valid CSS value.