descent-override

可用性有限

此特性不是基線特性,因為它在一些最廣泛使用的瀏覽器中不起作用。

descent-overrideCSS @font-face at-rule 的一個描述符,用於定義字型的下降度量。下降度量是基線以下的高度,CSS 用它在行內格式化上下文中佈局行框。

語法

css
descent-override: normal;
descent-override: 90%;

normal

預設值。使用此值時,度量值將從字型檔案中獲取。

<percentage>

一個 <percentage> 值。

正式定義

相關的 at-rule@font-face
初始值normal
百分比同指定值
計算值同指定值

正式語法

descent-override = 
[ normal | <percentage [0,∞]> ]{1,2}

示例

覆蓋備用字型的度量

當需要覆蓋備用字型的度量以更好地匹配主網頁字型的度量時,descent-override 屬性會很有幫助。

css
@font-face {
  font-family: "web-font";
  src: url("https://example.com/font.woff");
}

@font-face {
  font-family: "local-font";
  src: local("Local Font");
  descent-override: 125%;
}

規範

規範
CSS 字型模組第 4 級
# font-metrics-override-desc

瀏覽器相容性

另見