HTML & CSS Interview Question #74
What CSS properties are commonly used for typography?
CSS Fundamentals, Selectors, Cascade, Specificity, Box Model, Units & Typography Mid-Level Intermediate
Quick Interview Answer
Important typography properties include font-family, font-size, font-weight, font-style, line-height, letter-spacing, text-align, text-decoration, text-transform, and related text properties.
Detailed Explanation
Important typography properties include font-family, font-size, font-weight, font-style, line-height, letter-spacing, text-align, text-decoration, text-transform, and related text properties.
Good typography also considers readable line length, sufficient contrast, scalable units, fallback font families, and appropriate line height. CSS should not prevent users from zooming or resizing text when accessibility is important.
Code Example
body {
font-family:
Inter, Arial, sans-serif;
font-size: 1rem;
line-height: 1.6;
color: #1f2937;
}
h1 {
font-size: 2rem;
font-weight: 700;
letter-spacing: -.02em;
}