Widely available Supported across all major browsers. Safe to use in production.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
60
79
58
11.1
60
11.3
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

CSS
@font-face {
  font-family: "MyFont";
  src: url("/fonts/myfont.woff2") format("woff2");
  font-display: swap; /* fallback | block | optional | auto */
}

Live demo

swap

font-display descriptor Swap demo.

PreviewFullscreen

block

font-display descriptor Block demo.

PreviewFullscreen

optional

font-display descriptor Optional demo.

PreviewFullscreen

Use cases

  • Using font-display

    The font-display descriptor for the @font-face at-rule determines how a font face is displayed based on whether and when it is downloaded and ready to use.

Cautions

  • May not be supported in older browsers.

Accessibility

  • Make sure visual changes are conveyed appropriately to assistive technology.