Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

font-family — a list of font families

The font-family property specifies a prioritized list of font families. The browser selects an available font that supports the text, falling back to later entries when necessary.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

font-family: [ <font-family-name> | <generic-font-family> ]#;

font-family sets a comma-separated list of preferred font families. In the syntax notation, # means one or more comma-separated entries. The property is inherited, and its initial value depends on the browser.

A family is not an individual face: properties including font-weight and font-style participate in face selection. Fallback considers character coverage; a single piece of text can use several fonts.

Prefer quoting multiword names, such as "Courier New". Write generic families such as serif, sans-serif, and monospace without quotes. "monospace" names a specific family rather than the keyword. End the list with a generic family; its actual font depends on the environment.

The declaration alone does not download a font file. The font-family descriptor inside @font-face names a family, whereas this property selects families for text.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>font-family</title>
<style>
  body { font-family: monospace; }
  p { font-family: "Courier New", monospace; }
</style>
<p>Family fallback: ABC 012</p>
</html>

Result

Family fallback: ABC 012

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources