
A well-crafted font stack ensures your text looks great even when your primary font fails to load. Whether you're using webfonts or system fonts, understanding how to build resilient fallback chains is essential for professional web typography.
A font stack is a prioritized list of fonts in your CSS font-family declaration. The browser attempts to use each font in order until it finds one that's available:
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
If "Inter" fails to load, the browser falls back to the system UI font, then to platform-specific alternatives, and finally to the generic sans-serif.
Your brand or design choice—usually a webfont:
font-family: "Montserrat", ...;
Platform-native fonts that feel familiar and load instantly:
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell
Always end with a generic family:
sans-serif, serif, monospace, cursive, fantasy
Choose fallbacks with similar x-height, width, and weight to minimize layout shift:
@font-face {
font-family: "Inter Fallback";
src: local("Arial");
size-adjust: 107%;
ascent-override: 90%;
descent-override: 22%;
}
body {
font-family: "Inter", "Inter Fallback", sans-serif;
}
Always quote font names with spaces:
/* Correct */
font-family: "Segoe UI", Arial, sans-serif;
/* Wrong */
font-family: Segoe UI, Arial, sans-serif;
Place more specific fonts before generic ones:
/* Good: specific → platform → generic */
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
/* Bad: generic too early */
font-family: Arial, "Helvetica Neue", sans-serif;
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
font-family: "Segoe UI", Tahoma, Arial, sans-serif;
font-family: Roboto, "Noto Sans", "Droid Sans", sans-serif;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
For editorial or traditional designs:
font-family: "Merriweather", Georgia, Cambria, "Times New Roman", Times, serif;
For code and technical content:
font-family: "Fira Code", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
Consolas, "Liberation Mono", monospace;
/* Bad: no generic fallback */
font-family: "Inter", Arial;
/* Good */
font-family: "Inter", Arial, sans-serif;
/* Bad: too many similar fonts */
font-family: Helvetica, "Helvetica Neue", Arial, "Arial Nova", sans-serif;
/* Good: concise and effective */
font-family: "Helvetica Neue", Arial, sans-serif;
Failing to tune fallback metrics causes jarring layout shifts when fonts swap.
size-adjust and overridesA bulletproof font stack is your safety net. By carefully ordering fonts and matching metrics, you ensure readable, stable typography regardless of network conditions or platform quirks. Invest time in your fallback chain—it's the foundation of resilient web design.