Übersicht
The CSS Eigenschaft font-variant property selects a normal, or small-caps face from a font family. Setting font-variant is also possible by using the font shorthand.
| Initialwert | normal |
|---|---|
| Anwendbar auf | alle Elemente. Auch anwendbar auf ::first-letter und ::first-line. |
| Vererbt | Ja |
| Medien | visuell |
| Berechneter Wert | wie angegeben |
| Animierbar | Nein |
| Kanonische Reihenfolge | die eindeutige Reihenfolge definiert durch die formale Grammatik |
Syntax
Formal syntax: normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic(<feature-value-name>) || historical-forms || styleset(<feature-value-name> #) || character-variant(<feature-value-name> #) || swash(<feature-value-name>) || ornaments(<feature-value-name>) || annotation(<feature-value-name>) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ]wobei
<common-lig-values> = [ common-ligatures | no-common-ligatures ]
<discretionary-lig-values> = [ discretionary-ligatures | no-discretionary-ligatures ]
<historical-lig-values> = [ historical-ligatures | no-historical-ligatures ]
<contextual-alt-values> = [ contextual | no-contextual ]
<feature-value-name> = IDENT
<numeric-figure-values> = [ lining-nums | oldstyle-nums ]
<numeric-spacing-values> = [ proportional-nums | tabular-nums ]
<numeric-fraction-values> = [ diagonal-fractions | stacked-fractions ]
<east-asian-variant-values> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]
<east-asian-width-values> = [ full-width | proportional-width ]
font-variant: normal font-variant: small-caps font-variant: inherit
Werte
normal- Normale Schrift.
small-caps- Stellt die Schrift in Kapitälchen dar. Falls dies von der Schriftart nicht unterstützt wird, stellt Gecko den Effekt nach, indem die Kleinbuchstaben durch skalierte Grossbuchstaben ersetzt werden.
Der Wert
small-capshat in einigen Sprachen eine spezifische Wirkung:- In turkischen Sprachen (wie Türkisch (tr), Aserbaidschanisch (az), Krimtataren (crh), Tatarisch (tt) und Baschkirisch (ba)), gibt es zwei verschiedene Buchstaben
i, eines mit und eines ohne Punkt, und somit auch zwei verschiedene Buchstabenpaare:i/İundı/I. - Im Deutschen (de) wird das
ßzuSS. - Im Griechischen (el) verlieren Vokale ihren Akzent wenn sie Grossgeschriben sind (
ά/Α), mit Ausnahme von Eta (ή/Ή). Auch Diphthongen mit einem Akzent im ersten Vokal verliern diesen, dafür erhält der zweite Vokal einen (άι/ΑΪ).
Die Sprache wird in HTML mit dem Attribut
langHTML und in XML mitxml:langdefiniert.Diese spezifischen Anpassungen werden nicht von allen Browsern unterstützt, siehe Browser Kompatibilität.
- In turkischen Sprachen (wie Türkisch (tr), Aserbaidschanisch (az), Krimtataren (crh), Tatarisch (tt) und Baschkirisch (ba)), gibt es zwei verschiedene Buchstaben
Beispiele
p {
font-variant: small-caps;
}
Spezifikation
| Spezifikation | Status | Anmerkung |
|---|---|---|
| CSS Fonts Module Level 3 Die Definition von 'font-variant' in dieser Spezifikation. |
Anwärter Empfehlung | Extends the property (this is not yet reflected in this article) |
| CSS Level 2 (Revision 1) Die Definition von 'font-variant' in dieser Spezifikation. |
Empfehlung | No change. |
| CSS Level 1 Die Definition von 'font-variant' in dieser Spezifikation. |
Empfehlung |
Browser Kompatibilität
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | 1.0 | 1.0 (1.0) | 4.0 | 3.5 | 1.0 (85) |
ß → SS |
? | 1.0 (1.7 oder früher) | ? | ? | ? |
i → İ and ı → I |
Nicht unterstützt | 14 (14) | ? | ? | Nicht unterstützt |
| Greek accented letters | Nicht unterstützt | 15 (15) | Nicht unterstützt | Nicht unterstützt | Nicht unterstützt |
| Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? |
ß → SS |
? | ? | ? | ? | ? |
i → İ and ı → I |
Nicht unterstützt | 14 (14) | ? | ? | Nicht unterstützt |
| Greek accented letters | Nicht unterstützt | Nicht unterstützt | Nicht unterstützt | Nicht unterstützt | Nicht unterstützt |