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 valuen/a (required)
Computed valueas 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 compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
font-familyChrome Full support 4Edge Full support 12Firefox Full support 3.5IE Full support 6Opera Full support 10Safari Full support 3.1WebView Android Full support 2.2Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 3.1Samsung Internet Android Full support 1.0

Legend

Full support
Full support

See also