The font-family
CSS descriptor allows authors to specify the font family for the font specified in an @font-face
rule.
Related at-rule | @font-face |
---|---|
Initial value | n/a (required) |
Media | all |
Computed value | as specified |
Canonical order | the unique non-ambiguous order defined by the formal grammar |
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 syntax
<family-name>where
<family-name> = <string> | <custom-ident>+
Examples
@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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 4 | 12 | 3.5 | 6 | 9 | 3.1 |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic support | 2.2 | ? | 12 | 4 | 10 | 12 | 3.1 |