font-family CSS descriptor allows authors to specify the font family for the font specified in an @font-face rule.

句法

/* <string> values */
font-family: "font family";
font-family: 'another font family';
/* <custom-ident> value */
font-family: examplefont;
					

<family-name>

Specifies the name of the font family.

形式定义

相关 at-rule @font-face
初始值 n/a (required)
计算值 如指定

形式句法

<family-name>

where
<family-name> = <string> | <custom-ident>+

范例

Setting the font family name

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

规范

规范 状态 注释
CSS Fonts Module Level 3
The definition of 'font-family' in that specification.
候选推荐 初始定义

浏览器兼容性

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. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
font-family Chrome 完整支持 4 Edge 完整支持 12 Firefox 完整支持 3.5 IE 完整支持 6 Opera 完整支持 10 Safari 完整支持 3.1 WebView Android 完整支持 2.2 Chrome Android 完整支持 18 Firefox Android 完整支持 4 Opera Android 完整支持 10.1 Safari iOS 完整支持 3.1 Samsung Internet Android 完整支持 1.0

图例

完整支持

完整支持

另请参阅

元数据

  • 最后修改: