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 3The 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.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
font-family
|
Chrome
Full support 4 |
Edge
Full support 12 |
Firefox
Full support 3.5 |
IE
Full support 6 |
Opera
Full support 10 |
Safari
Full support 3.1 |
WebView Android
Full support 2.2 |
Chrome Android
Full support 18 |
Firefox Android
Full support 4 |
Opera Android
Full support 10.1 |
Safari iOS
Full support 3.1 |
Samsung Internet Android
Full support 1.0 |
Legend
- Full support
- Full support
See also
font-display
font-stretch
font-style
font-weight
font-variant
font-feature-settings
font-variation-settings
src
unicode-range
font-family by Mozilla Contributors is licensed under CC-BY-SA 2.5.