CSS / Reference / font-family: Font Lists, Glyph Fallback, and Loading
CSS font-family lists font candidates in priority order. When an earlier candidate can’t display the required character, the browser checks the next one. End the list with a generic family such as sans-serif so the browser can choose a fallback.
Write a font list with a generic fallback
Separate candidates with commas. Quotes make names containing spaces, such as "Malgun Gothic", clear. Leave generic names unquoted. "serif" asks for a specific family with that name. The CSS font-family specification defines the accepted values.
.mixed { font-family: Georgia, "Malgun Gothic", serif; }
.missing { font-family: "Missing Sample Family 91", Georgia, serif; }
.fixed { font-family: Consolas, monospace; }
| Generic family | When to use it | Sample |
|---|---|---|
serif |
Text with serifs at the ends of strokes | Aa 0123 |
sans-serif |
Text without serifs | Aa 0123 |
monospace |
Text with equal-width characters | Aa 0123 |
system-ui |
Text matching the platform interface style | Aa 0123 |
The initial font depends on the browser and platform settings. font-family inherits from the parent, though a browser rule can style form controls separately. Use font-family: inherit on inputs or buttons when they should follow the page’s font.
Understand fallback for individual characters
A glyph is a shape used to draw a character. When a font lacks a needed glyph, the browser tries another candidate. One sentence can therefore use Georgia for English and Malgun Gothic or another system font for Korean. See the CSS font matching algorithm for the matching order.
The browser also matches a face within each family for weight and style. When the exact weight is unavailable, it may choose a nearby weight or synthesize a bold appearance. Check font-weight when investigating the face selected within a family.
Compare the same text with different font lists
Save this as a UTF-8 file named font-family-example.html and open it in a browser. It downloads no fonts. Installed fonts and script coverage can change what the text looks like and how wide it is.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Font family comparison</title>
<style>
body { color: #20242b; font: 1rem/1.5 system-ui, sans-serif; margin: 1rem; }
main { max-width: 42rem; margin-inline: auto; }
.sample {
background: #eff5fa;
border: 1px solid #94aabb;
border-radius: .4rem;
padding: .75rem;
font-size: 1.5rem;
overflow-wrap: anywhere;
}
.mixed { font-family: Georgia, "Malgun Gothic", serif; }
.missing { font-family: "Missing Sample Family 91", Georgia, serif; }
.fixed { font-family: Consolas, monospace; }
</style>
</head>
<body>
<main>
<h1>Font family comparison</h1>
<p>Mixed English and Korean text</p>
<p class="sample mixed"><span id="latin" lang="en">Aa 0123</span> / <span id="hangul" lang="ko">한글 비교</span></p>
<p>Missing first font family</p>
<p class="sample missing" id="missing">Aa 0123</p>
<p>Monospaced text</p>
<p class="sample fixed" id="fixed">iiii | MMMM | 0123</p>
</main>
</body>
</html>
The first line combines English and Korean. The second skips the deliberately missing family and uses Georgia or the generic serif choice. On the third line, iiii and MMMM contain the same number of characters and occupy the same width in a monospaced font.
Temporarily remove only Georgia from the first line’s font list and check whether the English appearance changes. Record the fonts used before and after, then restore the original value.
Connect a web font file
A name in the font list doesn’t download a font file. Obtain a web font you’re licensed to use, register it with CSS @font-face specification, and request the same family name in the CSS for your content.
@font-face {
font-family: "Project Text";
src: url("./fonts/project-text.woff2") format("woff2");
font-style: normal;
font-weight: 400;
font-display: swap;
}
.article { font-family: "Project Text", system-ui, sans-serif; }
Replace project-text.woff2 with your file and resolve the URL from the stylesheet. The family names in both declarations must match. font-display: swap displays a fallback while the font loads and replaces it when the font is available.
Check the requested list and the rendered fonts
Inspect the element containing the text. In Chrome, Elements → Computed → Rendered Fonts shows which fonts drew its characters. The computed font-family shows the requested list. See Chrome’s guide to inspecting rendered fonts for the rendered view.
When the intended font is missing, verify the spelling, commas, and @font-face rule, then check the font request in Network. If the file loads and only certain characters differ, check glyph coverage. If spacing changes after a font swap, inspect line-height too.




