CSS - font-family
The font-family
CSS descriptor allows authors to specify the font family for the font specified in an @font-face
rule.
Example
CSS
Copy Code
@font-face { font-family: examplefont; src: url('examplefont.ttf'); }
Syntax
CSS
Copy Code
/* <string> values */ font-family: "font family"; font-family: 'another font family'; /* <IDENT> value */ font-family: examplefont;
Values
<family-name>
- Specifies the name of the font family.
Formal syntax
CSS
Copy Code
<a href="css/@font-face/font-family#family-name"><family-name></a><p>where <br><code><family-name> = <a title="" href="css/string"><string></a> <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> <IDENT><a title="Plus" href="css/value_definition_syntax#plus_(.2b)">+</a></code></p>
Description
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 |
Browser Compatibility
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 4 | 12.0 | 3.5 (1.9.1) | 6.0 | 9.0 | 3.1 |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mini | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 2.2 | 1.0 (1.9.1) | 10.0 | No support | 12.0 | 3.1 |
Specifications
Specification | Status | Comment |
---|---|---|
CSS Fonts Module Level 3 The definition of 'font-family' in that specification. |
Candidate Recommendation | Initial definition |
License
© 2016 Mozilla 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