font-synthesis-position
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.
Die font-synthesis-position CSS Eigenschaft ermöglicht es Ihnen, festzulegen, ob ein Browser die „position“-Schriftarten für Tief- und Hochstellungen synthetisieren darf, wenn diese in einer Schriftfamilie fehlen. Dabei wird font-variant-position verwendet, um die Positionen festzulegen.
Die font-synthesis-position Eigenschaft hat keine Auswirkung, wenn die <sup> und <sub> Elemente verwendet werden.
Es ist oft praktisch, die Kurzschreibweise font-synthesis zu verwenden, um alle Werte der Schriftart-Synthese zu steuern.
Syntax
/* Keyword values */ font-synthesis-position: auto; font-synthesis-position: none; /* Global values */ font-synthesis-position: inherit; font-synthesis-position: initial; font-synthesis-position: revert; font-synthesis-position: revert-layer; font-synthesis-position: unset; Werte
Formale Definition
| Anfangswert | none |
|---|---|
| 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-position =
auto |
none
Beispiele
>Deaktivierung der Synthese von Positions-Schriftarten
Dieses Beispiel zeigt, wie die Synthese der Hoch- und Tiefstellungs-Schriftarten in der Montserrat Schrift durch den Browser deaktiviert wird.
HTML
<p> These are the default position <span class="super">superscript</span>, position <span class="sub">subscript</span>, <strong>bold</strong> and <em>oblique</em> typefaces. </p> <p class="no-syn"> The positions <span class="super">superscript</span> and <span class="sub">subscript</span> typeface is turned off here but not the <strong>bold</strong> and <em>oblique</em> typefaces (on browsers that support <code>font-synthesis-position</code>). </p> CSS
@import "https://fonts.googleapis.com/css2?family=Montserrat&display=swap"; * { font-family: "Montserrat", sans-serif; } .super { font-variant-position: super; } .sub { font-variant-position: sub; } .no-syn { font-synthesis-position: none; } Ergebnis
Spezifikationen
| Specification |
|---|
| CSS Fonts Module Level 4> # font-synthesis-position> |
Browser-Kompatibilität
Loading…
Siehe auch
font-synthesisKurzschreibweise,font-synthesis-style,font-synthesis-weightfont-style,font-variant,font-variant-position,font-weight