font-family

font-family属性允许我们为页面上的字体指定一个由@font-face 规则定义的字体族

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

示例

@font-face {
  font-family: examplefont;
  src: url('examplefont.ttf');
}

规范

Specification Status Comment
CSS Fonts Module Level 3
font-family
Recommendation Initial definition

浏览器兼容性

BCD tables only load in the browser