Please enable JavaScript to use CodeHS

Web Design — Visual Design

Typography

Typography is the art of arranging text so people want to read it. The right font, size, spacing, and line height make a page feel polished, professional, and easy to understand.

Typography ~10 min Middle / High School
The Big Idea

Why typography matters

Most of the content on the web is text. If the text is hard to read, the design fails. Good typography is invisible: readers notice the ideas, not the letters. Bad typography is frustrating: readers squint, lose their place, or leave.

Typography also sets the personality of a site. A playful blog might use rounded, friendly fonts. A law firm's site might use classic, serious fonts. The same words can feel very different depending on how they are styled.


Vocabulary

Serif, sans-serif, and display fonts

Fonts are usually grouped into categories:

  • Serif fonts have small strokes at the ends of letters. They often feel traditional, formal, or bookish. Examples include Times New Roman and Georgia.
  • Sans-serif fonts do not have those strokes. They usually feel modern, clean, and friendly. Examples include Arial, Helvetica, and Montserrat.
  • Display or decorative fonts are designed for headlines and logos. They are fun but can be hard to read in long paragraphs.
  • Monospace fonts give every letter the same width. They are used for code and terminal-style text.

Design Skill

Size, line height, and spacing

Three simple settings have a big impact on readability:

  • Font size: body text is usually 16–18 pixels. Headings are larger. Small text is hard to read on screens.
  • Line height: the space between lines. A good default is 1.4–1.6 times the font size. Too little feels cramped; too much feels disconnected.
  • Letter spacing: the space between letters. Body text usually needs little or no extra spacing. Headlines sometimes look better with slightly tighter or looser spacing.

Critical Thinking

Font pairing

Most sites use two fonts: one for headings and one for body text. The contrast between them creates visual interest. Common pairings are a serif heading with a sans-serif body, or a bold display heading with a clean sans-serif body.

Avoid using too many fonts. Three is usually the maximum. More than that and the site starts to look messy or distracting.

Tip: when pairing fonts, look for contrast but not conflict. One can be loud; the other should be quiet.


Interactive

Type explorer

Use the controls to see how font family, size, line height, and letter spacing change the feel of a paragraph.

The quick brown fox jumps over the lazy dog. Good typography makes reading feel effortless, while poor typography makes readers work harder than they should.

Code

Typography in CSS

Typography is about choosing fonts and adjusting spacing so text is easy to read. This CSS sets up a readable body font and heading font.


Your Turn

Check yourself

Pick a website you use often. Is the body text serif or sans-serif? Does the line height feel comfortable? Would a different font change the site's personality?

Your answer:

Sample answer: A news site might use a serif body font to feel like a printed newspaper, with a clean sans-serif heading. A tech startup might use a sans-serif body to feel modern and friendly.


Check Yourself

Quick quiz

1. What is a serif?

2. Which setting controls the space between lines of text?

3. Why is it usually best to limit a site to two or three fonts?

Keep learning

You can make text readable and expressive. Next, learn how layout and spacing organize a page.

Part of the Web Design: Visual Design series.