Typography
What actually makes text readable. Four properties do most of the work.
font-family with a fallback stack, because your first choice may not be available.
font-size, in rem.
line-height, unitless, around 1.5 to 1.7 for body text. Unitless matters: it multiplies each element's own font size rather than inheriting a fixed measurement.
max-width on text containers, because a line longer than about 70 characters is measurably harder to read, since the eye loses its place returning to the next line.
✦ Font stacks and system-ui
font-family takes a comma-separated list and uses the first one available. Ending with a generic family such as serif or sans-serif guarantees something sensible. The keyword system-ui picks whatever the operating system uses, so the page feels native and loads instantly because nothing has to download.
Mark this lesson complete
Signed in, your progress follows you to every device.