font-family
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 |
---|---|
初始值 | n/a (required) |
计算值 | as specified |
语法
/* <string> values */
font-family: "font family";
font-family: 'another font family';
/* <IDENT> value */
font-family: examplefont;
取值
<family-name>
- 指定字体族名称
Formal syntax
<family-name>where
<family-name> = <string> | <custom-ident>+
示例
@font-face {
font-family: examplefont;
src: url('examplefont.ttf');
}
规范
Specification | Status | Comment |
---|---|---|
CSS Fonts Module Level 3 font-family |
Recommendation | Initial definition |
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
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 | 未实现 | 12.0 | 3.1 |