Font family
The ordered list of typefaces the browser should try.
Fonts shape the voice of an interface. The same text can feel technical, premium, playful or cheap depending on the typeface and fallback stack.
body {
font-family: Inter, system-ui, sans-serif;
}
Typography & Visual Style
A font family controls the typeface used to render text. CSS can use system fonts, local fonts and web fonts loaded from files or font services.
A good font stack always includes fallbacks. If the preferred font fails to load, the browser should still render readable text with a similar backup.
Professional typography is not about picking the fanciest typeface. It is about readability, tone, loading performance and consistency across headings, body text and interface labels.
The ordered list of typefaces the browser should try.
Backup fonts that keep text readable when the first choice fails.
Fast, familiar fonts already installed on the device.
Downloaded fonts that offer more brand control but need performance care.
Visual model
Typography and visual style are where CSS starts to feel like design. These models turn subjective choices into reusable decisions you can explain, test and improve.
Brand or product choice.
Fast operating system default.
Final safe category.
Examples
body {
font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
body {
font-family: FancyBrandFont;
}
h1 {
font-family: AnotherDecorativeFont;
}
Rules that matter
A beautiful one-off style is not enough. The goal is a visual system that keeps working when the site grows, content changes and new pages are added.
Body text should be easy to read before it feels branded.
A missing font should not break the visual quality of the page.
Too many typefaces make a site feel inconsistent and slow.
System stacks are reliable and load instantly.
Font files can delay rendering if they are too large or poorly configured.
A learning platform, dashboard and luxury landing page should not all sound the same typographically.
Production thinking
Fonts define the first emotional signal of a page. Users may not name the font, but they feel whether the interface looks careful or careless.
Readable fonts support dyslexia, zoom, scanning and long-form learning. Avoid overly decorative fonts for instructional content.
Audit font files, weights and fallbacks before launch. Loading five weights for one typeface can become unnecessary page weight.
Readable, fast-loading text helps users consume content and keeps the page experience strong.
Live code lab
The preview runs in an isolated iframe. Links and forms stay inside the practice area, so you can experiment without leaving the lesson.
Mini assignment
Practice assignment
Try it yourself
Self-check
Answer these questions before moving on. If your answer is vague, change the lab values and judge the visual result again.
Senior audit upgrade
Typography affects product feel, but web fonts also affect loading, rendering and layout stability.
Use font-display to control whether fallback text appears while fonts load.
Preload only critical fonts, otherwise preloading becomes noise.
A variable font can replace several files, but still needs performance testing.