typography

font-family

Sets a prioritized list of typefaces to render text with. The browser walks the list until it finds one that is available, so always end with a generic fallback.

font-family: <family-name> [, <family-name>]* [, <generic-family>]

Common values

Value Effect
system-ui Uses the operating system's default UI font
sans-serif Generic sans-serif fallback
serif Generic serif fallback
monospace Generic monospaced fallback
ui-monospace System monospaced UI font

Examples

body { font-family: 'Inter', system-ui, sans-serif; }

Prefers Inter, falls back to system UI font

code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

Native monospace font stack for code

h1 { font-family: Georgia, 'Times New Roman', serif; }

Serif headings with cross-platform fallbacks

Gotcha

Wrap multi-word family names in quotes and always include a generic family so text still renders if all custom fonts fail.

Related properties

← All CSS properties · CSS selectors · Grid vs Flexbox