Unsere Freiwilligen haben diesen Artikel noch nicht in Deutsch übersetzt. Machen Sie mit und helfen Sie, das zu erledigen!
Sie können den Artikel auch auf English (US) lesen.

The font-stretch CSS property selects a normal, condensed, or expanded face from a font.

/* Keyword values */
font-stretch: ultra-condensed;
font-stretch: extra-condensed;
font-stretch: condensed;
font-stretch: semi-condensed;
font-stretch: normal;
font-stretch: semi-expanded;
font-stretch: expanded;
font-stretch: extra-expanded;
font-stretch: ultra-expanded;

/* Global values */
font-stretch: inherit;
font-stretch: initial;
font-stretch: unset;

The two 'e' belong to the same fonts. One is condensed, the other normal and can be selected by 'font-stretch'.

Note: This property does not change the geometry of a font by stretching or shrinking it. Rather, like font-feature-settings or font-variant, it selects the most appropriate font face.

For example, on macOS, in addition to the more common Bold, Regular, Italic, and BoldItalic faces, the "Helvetica Neue" font offers a second set of faces with compact characters: Condensed. Browsers will render this font with the condensed faces for the values semi-condensed through ultra-condensed, and the normal faces for all other values:

Font-stretch results with a font having 2 faces, one condensed and one normal.

If the specified font has no condensed or expanded faces, like the default "Times New Roman" on macOS, font-stretch will not have any visible effect:
Font-stretch results with a font having 1 single face.

Syntax

Values

normal
Specifies a normal font face.
semi-condensed, condensed, extra-condensed, ultra-condensed
Specifies a font face more condensed than normal, with ultra-condensed as the most condensed.
semi-expanded, expanded, extra-expanded, ultra-expanded
Specifies a font face more expanded than normal, with ultra-expanded as the most expanded.

Interpolation

Font stretch values are interpolated in discrete steps. The interpolation happens as though the ordered values are equally spaced real numbers; the result is rounded to the nearest value, with values exactly halfway between two values rounded towards the later value, i.e., towards the most expanded one.

Formal syntax

normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded

Example

HTML

<div class="ultra stretch">This is text with the font extremely stretched.</div>
<div class="stretch">This is text with the font stretched.</div>
<div class="normal">This is text without font stretching.</div>
<div class="condensed">This is text with the font condensed.</div>
<div class="ultra condensed">This is text with the font extremely condensed.</div>

CSS

.ultra.stretch { font-stretch: ultra-expanded; }
.stretch { font-stretch: expanded; } 
.normal { font-stretch: normal; }
.condensed { font-stretch: condensed; }
.ultra.condensed { font-stretch: ultra-condensed; }

Result

Specifications

Specification Status Comment
CSS Fonts Module Level 3
The definition of 'font-stretch' in that specification.
Candidate Recommendation Initial definition

Note: The font-stretch property was initially defined in CSS 2, but dropped in CSS 2.1 due to the lack of browser implementation. It was brought back in CSS 3.

Initial valuenormal
Applies toall elements. It also applies to ::first-letter and ::first-line.
Inheritedyes
Mediavisual
Computed valueas specified
Animation typea font stretch
Canonical orderthe unique non-ambiguous order defined by the formal grammar

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support4812993511
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidIE mobileOpera AndroidiOS Safari
Basic support No ?129 ? No ?

Schlagwörter des Dokuments und Mitwirkende

Schlagwörter: 
 Zuletzt aktualisiert von: mfluehr,