font-display
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
font-display
属性决定了一个 @font-face 在不同的下载时间和可用时间下是如何展示的。
字体显示时间轴
语法
css
/* 关键字值 */
font-display: auto;
font-display: block;
font-display: swap;
font-display: fallback;
font-display: optional;
属性值
形式化语法
例子
css
@ font-face {
font-family: ExampleFont;
src: url(/path/to/fonts/examplefont.woff)format('woff'),
url(/path/to/fonts/examplefont.eot)format('eot');
font-weight: 400;
font-style: normal;
font-display: fallback;
}
规范
Specification |
---|
CSS Fonts Module Level 4 # font-display-desc |
浏览器兼容性
BCD tables only load in the browser