Course contentsShow
← Web Development
Lesson 1277 of 2,98223. Web Font OptimizationFree lesson

font-display: auto Behavior

Understand browser-default font-display behavior and why explicit values are generally preferred.

font-display: auto Behavior

What you'll learn: You'll understand what happens when you use font-display: auto (or omit font-display entirely) and why being explicit is usually better.


What Does auto Mean?

When you set font-display: auto, you're telling the browser: "I don't have a preference—use whatever strategy you think is best." In practice, this usually means the browser chooses its own default behavior, which historically has been similar to block in most browsers.

@font-face {
  font-family: 'MyWebFont';
  src: url('font.woff2') format('woff2');
  font-display: auto; /* Browser decides */
}

Omitting font-display entirely is the same as using auto.


Why This Is Problematic

The issue with auto is unpredictability. Different browsers might choose different strategies, and those defaults can change over time. You lose control over the user experience:

  • One browser might hide text for several seconds (block-like behavior)
  • Another might show fallback text immediately (swap-like behavior)
  • Users on slow connections might experience inconsistent loading behavior

Think of it like ordering "chef's choice" at a restaurant — you might get something great, or something you don't like, and it might change depending on who's cooking that day.


Why Explicit Values Are Preferred

By choosing block, swap, fallback, or optional yourself, you:

  • Control the experience across all browsers
  • Make conscious trade-offs between typography and performance
  • Create predictable, testable behavior for your users

Even if you want block-like behavior, explicitly writing font-display: block is better than relying on auto.


Key Takeaway: font-display: auto leaves font loading behavior up to the browser's defaults, which can be inconsistent—always choose an explicit strategy to maintain control over your user experience.