W3cubDocs

/CSS

@font-face.font-family

The font-family CSS descriptor allows authors to specify the font family for the font specified in an @font-face rule.

Syntax

/* <string> values */
font-family: "font family";
font-family: 'another font family';

/* <custom-ident> value */
font-family: examplefont;

Values

<family-name>
Specifies the name of the font family.

Formal definition

Related at-rule @font-face
Initial value n/a (required)
Computed value as specified

Formal syntax

<family-name>

where
<family-name> = <string> | <custom-ident>+

Examples

Setting the font family name

@font-face {
  font-family: examplefont;
  src: url('examplefont.ttf');
}

Specifications

Specification Status Comment
CSS Fonts Module Level 3
The definition of 'font-family' in that specification.
Candidate Recommendation Initial definition

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
font-family 4 12 3.5 6 10 3.1
Mobile
Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
font-family 2.2 18 4 10.1 3.1 1.0

See also

© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-family