font-synthesis-small-caps
font-synthesis-small-caps CSS 屬性讓你指定當字型家族中缺少小型大寫字母(small-caps)字形時,瀏覽器是否可以合成該字形。小型大寫字母通常採用大寫字母的形式,但會縮小到小寫字母的大小。
通常,使用簡寫屬性 font-synthesis 來控制所有字型合成值會更方便。
語法
css
/* Keyword values */
font-synthesis-small-caps: auto;
font-synthesis-small-caps: none;
/* Global values */
font-synthesis-small-caps: inherit;
font-synthesis-small-caps: initial;
font-synthesis-small-caps: revert;
font-synthesis-small-caps: revert-layer;
font-synthesis-small-caps: unset;
值
正式定義
| 初始值 | auto |
|---|---|
| 應用於 | 所有元素和文字。它也適用於 ::first-letter 和 ::first-line。 |
| 繼承性 | 是 |
| 計算值 | 同指定值 |
| 動畫型別 | 離散 |
正式語法
font-synthesis-small-caps =
auto |
none
示例
停用小型大寫字母字形的合成
此示例展示了在 Montserrat 字型中關閉瀏覽器合成小型大寫字母字形。
HTML
html
<p class="english">
These are the default <span class="small-caps">small-caps</span>,
<strong>bold</strong>, and <em>oblique</em> typefaces.
</p>
<p class="english no-syn">
The <span class="small-caps">small-caps</span> typeface is turned off here but
not the <strong>bold</strong> and <em>oblique</em> typefaces.
</p>
CSS
css
@import "https://fonts.googleapis.com/css2?family=Montserrat&display=swap";
.english {
font-family: "Montserrat", sans-serif;
}
.small-caps {
font-variant: small-caps;
}
.no-syn {
font-synthesis-small-caps: none;
}
結果
規範
| 規範 |
|---|
| CSS 字型模組第 4 級 # font-synthesis-small-caps |
瀏覽器相容性
載入中…