font-synthesis-small-caps CSS property
Baseline
Weitgehend verfügbar
Diese Funktion ist gut etabliert und funktioniert auf vielen Geräten und in vielen Browserversionen. Sie ist seit März 2023 browserübergreifend verfügbar.
Die font-synthesis-small-caps CSS Eigenschaft ermöglicht es Ihnen festzulegen, ob der Browser einen Small-Caps-Schrifttyp synthetisieren darf, wenn dieser in einer Schriftfamilie fehlt. Small-Caps-Glyphen verwenden typischerweise die Form von Großbuchstaben, sind aber auf die Größe von Kleinbuchstaben reduziert.
Es ist oft praktisch, die Kurzform-Eigenschaft font-synthesis zu verwenden, um alle Schrifttyp-Synthesewerte zu steuern.
Syntax
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;
Werte
Formale Definition
| Anfangswert | auto |
|---|---|
| Anwendbar auf | all elements and text. Auch anwendbar auf ::first-letter und ::first-line. |
| Vererbt | Ja |
| Berechneter Wert | wie angegeben |
| Animationstyp | diskret |
Formale Syntax
font-synthesis-small-caps =
auto |
none
Beispiele
>Deaktivierung der Synthese des Small-Caps-Schrifttyps
Dieses Beispiel zeigt, wie die Synthese des Small-Caps-Schrifttyps durch den Browser in der Montserrat-Schrift deaktiviert wird.
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;
}
Ergebnis
Spezifikationen
| Spezifikation |
|---|
| CSS Fonts Module Level 4> # font-synthesis-small-caps> |