Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 4.3 — Size, Weight, Style and Line Height
CSS · Example 3 of 3

Readable measure

ch is the width of the 0 character in the current font, so the limit grows and shrinks with the text size.

font-size, font-weight, font-style and line-height set how big, how thick, how slanted and how spaced text is; a unitless line height and a line length of about 45–75 characters make text comfortable to read.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Style an article: base text 1.125rem with line height 1.6, headings at line height 1.2, and lines no longer than 70 characters.

02

Rewrite these four declarations as one font shorthand: font-style: italic; font-weight: 600; font-size: 1.25rem; line-height: 1.4; with the family Georgia, serif.

03

A <small> inside a paragraph has font-size: 0.8em and the paragraph is 20px. How big is the small text? What if it were 0.8rem?

Explain it without notes

01

Why is a unitless line-height safer than 1.5em or 150%?

02

What does the font shorthand require, and what is the danger of using it?

03

What do bolder and lighter do, and why might font-weight: 600 look the same as 700?

04

What is a readable measure, and how do you set it in CSS?

Readable measure

Preview

Press Run to see the page.

Console

Nothing logged yet.