font-family

The font-family CSS property specifies a prioritized list of one or more font family names and/or generic family names for the selected element.

Example

Initial value depends on user agent
Applies to all elements. It also applies to ::first-letter and ::first-line.

Syntax

  
font-family: Georgia, serif;
  

Values

The name of a font family. For example, "Times" and "Helvetica" are font families. Font family names containing whitespace should be quoted.
Generic font families are a fallback mechanism, a means of preserving some of the style sheet author's intent when none of the specified fonts are available. Generic family names are keywords and must not be quoted. A generic font family should be the last item in the list of font family names. The following keywords are defined: serif Glyphs have finishing strokes, flared or tapering ends, or have actual serifed endings. E.g. Lucida Bright, Lucida Fax, Palatino, "Palatino Linotype", Palladio, "URW Palladio", serif. sans-serif Glyphs have stroke endings that are plain. E.g. "Open Sans", "Fira Sans", "Lucida Sans", "Lucida Sans Unicode", "Trebuchet MS", "Liberation Sans", "Nimbus Sans L", sans-serif. monospace All glyphs have the same fixed width. E.g. "Fira Mono", "DejaVu Sans Mono", Menlo, Consolas, "Liberation Mono", Monaco, "Lucida Console", monospace. cursive Glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyond those of italic typefaces. The glyphs are partially or completely connected, and the result looks more like handwritten pen or brush writing than printed letterwork. E.g. "Brush Script MT", "Brush Script Std", "Lucida Calligraphy", "Lucida Handwriting", "Apple Chancery", cursive. fantasy Fantasy fonts are primarily decorative fonts that contain playful representations of characters. E.g. Papyrus, Herculanum, Party LET, Curlz MT, Harrington, fantasy. system-ui Glyphs are taken from the default user interface font on a given platform. Because typographic traditions vary widely across the world, this generic is provided for typefaces that don't map cleanly into the other generics. This is example system-ui text. ui-serif The default user interface serif font. This is example ui-serif text. ui-sans-serif The default user interface sans-serif font. This is example ui-sans-serif text. ui-monospace The default user interface monospace font. This is example ui-monospace text. ui-rounded The default user interface font that has rounded features. This is example ui-rounded text. math This is for the particular stylistic concerns of representing mathematics: superscript and subscript, brackets that cross several lines, nesting expressions, and double struck glyphs with distinct meanings. This is some example math text: ax² + bx + c = 0. emoji Fonts that are specifically designed to render emoji. This is some example emoji text: ✝♾. fangsong A particular style of Chinese characters that are between serif-style Song and cursive-style Kai forms. This style is often used for government documents. This is some example fangsong text with the Chinese characters for "fangsong" in traditional and simple forms, respectively: 仿宋體 仿宋体.
Glyphs have finishing strokes, flared or tapering ends, or have actual serifed endings. E.g. Lucida Bright, Lucida Fax, Palatino, "Palatino Linotype", Palladio, "URW Palladio", serif.
Glyphs have stroke endings that are plain. E.g. "Open Sans", "Fira Sans", "Lucida Sans", "Lucida Sans Unicode", "Trebuchet MS", "Liberation Sans", "Nimbus Sans L", sans-serif.
All glyphs have the same fixed width. E.g. "Fira Mono", "DejaVu Sans Mono", Menlo, Consolas, "Liberation Mono", Monaco, "Lucida Console", monospace.
Glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyond those of italic typefaces. The glyphs are partially or completely connected, and the result looks more like handwritten pen or brush writing than printed letterwork. E.g. "Brush Script MT", "Brush Script Std", "Lucida Calligraphy", "Lucida Handwriting", "Apple Chancery", cursive.
Fantasy fonts are primarily decorative fonts that contain playful representations of characters. E.g. Papyrus, Herculanum, Party LET, Curlz MT, Harrington, fantasy.
Glyphs are taken from the default user interface font on a given platform. Because typographic traditions vary widely across the world, this generic is provided for typefaces that don't map cleanly into the other generics. This is example system-ui text.
The default user interface serif font. This is example ui-serif text.
The default user interface sans-serif font. This is example ui-sans-serif text.
The default user interface monospace font. This is example ui-monospace text.
The default user interface font that has rounded features. This is example ui-rounded text.
This is for the particular stylistic concerns of representing mathematics: superscript and subscript, brackets that cross several lines, nesting expressions, and double struck glyphs with distinct meanings. This is some example math text: ax² + bx + c = 0.
Fonts that are specifically designed to render emoji. This is some example emoji text: ✝♾.
A particular style of Chinese characters that are between serif-style Song and cursive-style Kai forms. This style is often used for government documents. This is some example fangsong text with the Chinese characters for "fangsong" in traditional and simple forms, respectively: 仿宋體 仿宋体.

Browser support

font-family112133.51

We use cookies to improve your experience. Learn more in our Privacy policy.

×