font-family CSS 描述符为 @font-face At 规则中指定的字体设置字体族。
该值用于在使用 font-family 属性对元素进行样式设置时,与特定的 @font-face 名称进行匹配。可以使用任何名称,并且该名称会覆盖底层字体数据中指定的任何名称。
语法
/* <string> 值 */
font-family: "font family";
font-family: "another font family";
/* <custom-ident> 值 */
font-family: example-font;
值
<family-name>- : 指定字体族的名称。
形式定义
形式语法
示例
设置字体族
@font-face {
font-family: "字体族名称";
src: url("some_font_name.ttf");
}
规范
浏览器兼容性
参见
- @font-face/font-display
- @font-face/font-stretch
- @font-face/font-style
- @font-face/font-weight
- font-feature-settings
- @font-face/font-variation-settings
- @font-face/src
- @font-face/unicode-range
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
