liveBook · Manning

@font-face

The CSS @font-face at-rule defines a font resource and descriptors that associate it with a font family and style.

How 4 Manning books explain it

CSS in Depth, Second Edition

The CSS @font-face at-rule defines a downloadable font resource and the descriptors that associate it with a font family and style.

How it is used
Defines downloadable web fonts for page typography and supports deliberate control over family, style, weight, character sets, and loading.
How deep it goes
Explains descriptors, variants, character-range optimization, and loading behavior, while deferring deeper web-font performance treatment.
Examples
Uses Roboto and Sansita definitions, separate light and bold variants, Google Fonts stylesheets, and downloadable WOFF2 resources.
What you can do after
Build custom-font CSS, register local or hosted resources, select matching variants, and manage fallback behavior during loading.

Read how CSS in Depth, Second Edition explains @font-face →

Web Design Playground, Second Edition

The CSS @font-face at-rule defines a font resource and the information a browser needs to load it.

How it is used
Defines web font resources so browsers can load consistent typography instead of depending on visitors’ installed system fonts.
How deep it goes
Explains the rule’s purpose, descriptors, hosting choices, licensing concern, and font formats through short working examples.
Examples
Uses Bree Serif with WOFF2 and WOFF files, and practices a Google Fonts Merriweather setup with a generic fallback.
What you can do after
Apply it via CSS by declaring a hosted font, supplying file formats, and assigning the font to page elements.

Read how Web Design Playground, Second Edition explains @font-face →

Web Design Playground

A CSS at-rule that defines a downloadable font face for use in a document.

How it is used
Uses @font-face to load hosted font files so visitors need not have the chosen typeface installed.
How deep it goes
Shows a two-format rule, self-hosting considerations, and three file paths; leaves detailed format compatibility unexplained.
Examples
Shows WOFF2 and WOFF sources, three font-file URLs, and a Merriweather practice prompt.
What you can do after
Build it from scratch by hosting a licensed font, defining its face, and choosing a URL that matches its location.

Read how Web Design Playground explains @font-face →

Tiny CSS Projects

@font-face is a CSS at-rule that defines a font resource and its loading and typographic characteristics.

How it is used
Defines imported web fonts and controls their available styles, weights, sources, and loading behavior.
How deep it goes
Explains four descriptors, source fallback, variable weight ranges, font blocking, and stylesheet placement without deeper font internals.
Examples
Demonstrates normal and italic Open Sans using variable and static files, local lookup, WOFF2 sources, and a variable weight range.
What you can do after
Operate/configure custom web fonts with ordered sources, explicit formats, weight declarations, and non-blocking swap behavior.

Read how Tiny CSS Projects explains @font-face →

What to know first

Related concepts

Questions about @font-face

What is @font-face?

The CSS @font-face at-rule defines a font resource and descriptors that associate it with a font family and style.

Which Manning books explain @font-face?

CSS in Depth, Second Edition, Web Design Playground, Second Edition, Web Design Playground and Tiny CSS Projects.

What should I know before learning @font-face?

Manning books that teach @font-face usually introduce font file format first.

What is @font-face a kind of?

@font-face is a kind of at-rule. A CSS at-rule is a statement beginning with an at sign that provides directives or conditional instructions to the stylesheet processor.

What are the parts of @font-face?

@font-face includes font-display.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.