Your Interface's Voice
A font is not just letters, it's the brand's character. In CSS, we control this through font-family.
1. Five Basic Families
Browsers divide all fonts into 5 main groups:
- Serif (with serifs): Letters have small " feet " . Classic, books (
Times New Roman). - Sans-serif (without serifs): Modern, clean look. Perfect for screens (
Arial,Inter). - Monospace (monospaced): Each letter occupies the same space. For code (
Courier,Consolas). - Cursive: Imitation of handwriting.
- Fantasy: Decorative fonts.
2. Font Stack (Safe List)
You never know what font the user has installed. So we write a " stack " — a list of names from rarest to most common.
body {
font-family: "My Brand Font", "Helvetica Neue", Arial, sans-serif;
}
Tip
Always put font names consisting of two or more words in quotes. Single words can be written without them.
Note
Using " system fonts " (e.g., -apple-system) is a trend. The site looks like a native system app and loads instantly.