font-family
语法
css/*
font-family: "font family";
font-family: "another font family";
/*
font-family: example-font;
值
指定字体族的名称。
形式定义
Related at-rule@font-face初始值n/a (required)计算值as specified
形式语法
font-family =
此语法反映了基于 CSS Fonts Module Level 4 的最新标准。并非所有浏览器都已实现全部内容。有关支持信息,请参阅浏览器兼容性。
示例
设置字体族
css@font-face {
font-family: "字体族名称";
src: url("some_font_name.ttf");
}
规范
规范
CSS Fonts Module Level 4# font-family-desc
浏览器兼容性
参见
font-display
font-stretch
font-style
font-weight
font-feature-settings
font-variation-settings
src
unicode-range
帮助改进 MDN
此页面对您有帮助吗?
是
否
了解如何参与贡献
此页面最后更新于 2025年11月6日,由 MDN 贡献者更新。
在 GitHub 上查看此页面 • 报告此内容的问题