📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials CSS Mastery Typography

Typography

5 min read Quiz at the end
font-family sets the typeface with fallbacks. Use rem for font-size to respect user preferences. line-height: 1.5 improves readability. clamp(1rem, 2.5vw, 1.5rem) creates a fluid font size that scales with viewport.

Typography

body {
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: 0.01em;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 3rem); /* responsive */
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}
Topic Quiz · 5 questions

Test your understanding before moving on

1. Which property controls font size?
💡 font-size sets the size of the text.
2. What does line-height control?
💡 line-height controls the space between lines in a text block.
3. Which unit is relative to root font size?
💡 rem (root em) is relative to the root <html> element's font size.
4. What does font-weight: 700 mean?
💡 700 is bold. Weights range from 100 (thin) to 900 (extra bold).
5. What does clamp() do for font-size?
💡 clamp(min, preferred, max) creates a responsive value that scales with the viewport.