Web and Screen Typography
Learn how web fonts load, what font-display and fallback stacks do, how variable fonts and fluid type work, and how to keep text fast and readable.
Welcome back!
Step 1 of 12Learn
How fonts reach a web page
On a website, text is rendered with fonts the browser can access, which come from two sources:
- System fonts already installed on the visitor's device. They load instantly but vary between operating systems, so the same page looks slightly different on different devices.
- Web fonts downloaded from your server or a font service when the page loads. They give consistent branding, at the cost of extra download time.
The standard format for web fonts is WOFF2, a compressed format supported by all modern browsers. A single style of a text font is often somewhere around 20–60 KB; a page loading eight weights and styles of two families can add several hundred kilobytes before any text appears in its final font.
Because fonts load over the network, there is a moment when the text is ready but the font is not. Browsers then either hide the text briefly (a flash of invisible text) or show it in a fallback font first and swap when the web font arrives (a flash of unstyled text). The CSS property font-display controls this. The value swap shows fallback text immediately and swaps later, which keeps content readable on slow connections.
Good practice: load only the weights and styles you actually use, host or preload the most important ones, and choose a fallback font with similar proportions to reduce layout jumps when the swap happens.
Step 2 of 12Compare
System fonts vs web fonts
| Aspect | System fonts | Web fonts |
|---|---|---|
| Where they come from | Already on the visitor’s device | Downloaded with the page (WOFF2) |
| Load time | Instant | Extra download, often 20–60 KB per style |
| Consistency | Varies by operating system | Same look everywhere |
| Brand control | Limited | Full |
| Main risk | Bland or inconsistent look | Invisible or jumping text while loading |
Step 3 of 12Practice · Choose one
A page loads its web font slowly, and visitors see blank space where text should be for a few seconds. Which setting addresses this most directly?
Step 4 of 12Learn
Font stacks and fallbacks
In CSS, you specify fonts as a font stack: a list of choices in order of preference, ending with a generic family. For example:
font-family: "Source Serif", Georgia, "Times New Roman", serif;
The browser uses the first font that is available. If the web font fails to load, it falls back to Georgia, then Times New Roman, and finally whatever serif font the device has.
Many sites now use a system font stack for interface text, which simply asks for each operating system's built-in UI font. It loads instantly, looks native on every device and works well for apps and dashboards.
Choose fallbacks thoughtfully:
- Match the classification: serif falls back to serif, sans to sans, monospace to monospace.
- Match proportions: a fallback with a similar x-height and width reduces the visible jump when the web font swaps in. Modern CSS even lets you adjust fallback metrics to match the web font closely.
- Always end with a generic family (serif, sans-serif, monospace, system-ui) so the browser never falls back to something inappropriate.
Fonts also need the right character set. If your site is in several languages, check that the web font includes all the accented letters and scripts you need; otherwise the browser will mix fonts within a word, which looks broken.
Step 5 of 12Practice · Diagram
How a font stack falls back
font-family: "Source Serif", Georgia, "Times New Roman", serif; The browser walks the list until a font is available.
The web font fails to load and the device has no Georgia. Which font does the text appear in?
Tap the shape that answers the question, then press Check.
- Source Serif (web font)
First choice. Used once the file has loaded.
- Georgia
A common system serif, used if the web font fails.
- Times New Roman
Next system fallback if Georgia is not installed.
- serif (generic)
Always available: the browser’s default serif. Every stack should end with one.
Step 6 of 12Note
Step 7 of 12Practice · Fill in the blanks
Fill in the blanks
A CSS font stack should always end with a such as serif or sans-serif. The compressed web font format supported by all modern browsers is .
Step 8 of 12Learn
Variable fonts and fluid type
Variable fonts are a newer font technology in which a single file contains a continuous range along one or more axes, such as weight (from thin to black), width (condensed to wide), optical size or slant. Instead of loading separate files for regular, semibold and bold, a site can load one variable font and use any weight in between, like 450 or 620.
Benefits:
- Fewer files and often less total data when you use several styles.
- Fine control: a slightly heavier weight for white text on dark backgrounds, or a bolder weight for small sizes.
- Optical size axes automatically adjust letterforms for small and large sizes, as metal type designers once did by cutting separate designs for each size.
Fluid typography makes font sizes scale smoothly with the screen width instead of jumping at breakpoints. In CSS, the clamp() function sets a minimum, a preferred value that depends on the viewport, and a maximum, for example: font-size: clamp(1.75rem, 1rem + 3vw, 3rem). The heading never gets smaller than 1.75 rem or larger than 3 rem, and scales in between.
Keep the minimums sensible and use rem units inside clamp() so that text still responds when users increase their browser's default font size. Viewport-only sizing such as font-size: 5vw ignores user preferences and can make text impossible to enlarge, which is an accessibility failure.
Step 9 of 12Try the calculator
Fluid heading size estimator
This mimics clamp(min, base + slope × viewport, max) for a heading. Enter values in px; vw means 1% of the viewport width.
- Preferred value before clamping
- 27.7 px
- Resulting heading size
- 28 px
Step 10 of 12Practice · Work it out
A heading uses clamp(24px, 12px + 2vw, 40px). What size, in px, does it get on a 1000 px wide viewport?
Step 11 of 12Note
Step 12 of 12Practice · Select all that apply
Which practices help web typography load fast and stay readable? Select all that apply.
Select all that apply.
Lesson complete!