Why Typography Deserves Its Own Lesson
Good typography is invisible — readers don't notice it, they just read comfortably. Bad typography is the opposite: cramped lines, mismatched fonts, and inconsistent sizing make a page feel unpolished even if everything else about the design is solid.
- ✓font-family sets the typeface; font-size and font-weight control size and boldness.
- ✓Google Fonts lets you load custom web fonts without hosting any files yourself.
- ✓line-height and letter-spacing shape how comfortable a block of text is to read.
The Properties You'll Use Constantly
The typeface. Always list a fallback in case the first choice fails to load.
How large the text renders — in px, rem, or em.
How bold the text is — from 100 (thin) to 900 (black).
Vertical space between lines of text within a paragraph.
Horizontal space between individual characters.
Horizontal alignment of text — left, center, right, or justify.
body { font-family: "Inter", Arial, sans-serif; font-size: 16px; line-height: 1.6; } h1 { font-weight: 700; letter-spacing: -0.02em; }
Loading a Custom Web Font
Google Fonts hosts free, ready-to-use fonts. Link the stylesheet in your <head>, then reference the font by name in your CSS — no font files to download or host yourself.
<head> <link rel="preconnect" href="https://fonts.googleapis.com"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet"> </head>
body { font-family: "Inter", sans-serif; }
font-family: "Inter", sans-serif; — if "Inter" fails to load for any reason, the browser falls back to the system's default sans-serif font instead of breaking the layout.
Sizing Text With Purpose
A type scale is a small, consistent set of font sizes used across a whole site — instead of picking a random size every time, you reuse the same handful so the page feels cohesive.
The Property Beginners Skip
The default line-height is often too tight for comfortable reading, especially for longer paragraphs. A value between 1.5 and 1.7 for body text noticeably improves readability.
Breaking Down What You Just Learned
Core propertiesfont-family, font-size, font-weight, line-height, and letter-spacing shape all text.
Fallback fontsAlways list a generic fallback after your primary font choice.
Google FontsLink a stylesheet, then reference the font family name in your CSS.
Type scaleA small, reused set of font sizes keeps a page's typography consistent.
line-heightA value around 1.5–1.7 for body text meaningfully improves readability.
Try It Yourself
Load a Google Font of your choice, apply it to your page's body, and set up a five-level type scale for h1, h2, h3, body text, and captions using rem units.
Type a Full Article Page
Putting a full typography system into practice
Create day19.html and style a short article using everything from today.
- Link two Google Fonts — one for headings, one for body text.
- Write an article with an h1, two h2 subheadings, and three paragraphs of body text.
- Apply your type scale so each heading level is visibly distinct in size and weight.
- Set line-height: 1.6 on paragraphs and letter-spacing: -0.02em on the h1.
- Compare the page with line-height removed to see the readability difference for yourself.
Recap
font-family, font-size, font-weight, line-height, letter-spacing.
Free web fonts loaded via a linked stylesheet, no hosting required.
A consistent, reused set of font sizes across the whole page.
1.5–1.7 for body text meaningfully improves comfort while reading.
Key Takeaways
- font-family, font-size, font-weight, line-height, and letter-spacing shape all text on a page.
- Always pair a custom font with a generic fallback in case it fails to load.
- Google Fonts lets you load professional web fonts with a single linked stylesheet.
- A small, reused type scale keeps headings and body text visually consistent.
- A line-height between 1.5 and 1.7 makes body text noticeably easier to read.