CSS Reference ยท Typography
The font-stretch property
Reference for the CSS font-stretch property: keywords and percentages for condensed and expanded faces, how it works with variable fonts, with live examples.
The font-stretch property selects a normal, condensed or expanded width of a font. It does not scale glyphs horizontally. It asks the font family for a face that was designed narrower or wider, and the browser uses the closest match.
If the family has no width variants, nothing changes. Newer specifications call the same feature font-width, but font-stretch remains the name that works everywhere.
.table-label { font-stretch: condensed; } .hero { font-stretch: 125%; }
Try it
The example asks for a family that is variable in width on some systems (Bahnschrift on recent Windows). Where it is missing, the fallback fonts have a single width, so the lines look the same. Variable web fonts with a width axis give the same result on every device.
Syntax
font-stretch: <percentage [0,โ]> | ultra-condensed | extra-condensed | condensed
| semi-condensed | normal | semi-expanded | expanded
| extra-expanded | ultra-expanded;
| Initial value | normal |
| Applies to | All elements and text |
| Inherited | Yes |
| Animatable | Yes (as a percentage) |
| Computed value | The keyword as a percentage |
Values
| Value | Description |
|---|---|
ultra-condensed |
50% |
extra-condensed |
62.5% |
condensed |
75% |
semi-condensed |
87.5% |
normal |
100% |
semi-expanded |
112.5% |
expanded |
125% |
extra-expanded |
150% |
ultra-expanded |
200% |
<percentage> |
Any non-negative percentage; useful with variable fonts that offer a continuous width axis. |
Usage notes
- Not a transform. Use
transform: scaleX()if you want to squash glyphs, but that distorts stroke widths and is rarely good typography. - Needs font support. Static fonts expose widths as separate families or faces, such as "Arial Narrow". Variable fonts expose a
wdthaxis, whichfont-stretchdrives. - Web fonts. In
@font-facethefont-stretchdescriptor tells the browser which width each file covers; a range such as75% 125%fits a variable file. - Fine control.
font-variation-settings: "wdth" 110sets the axis directly, but preferfont-stretchwhere it is enough. - Layout shifts. Changing the width changes the text length, so animating it can reflow lines.
Browser support
Keyword values have long been supported, but the effect depends on the fonts available; check a compatibility table for percentage values.
Related
font-weightโ heavier or lighter facesfont-styleโ italic and obliquefont-variation-settingsโ axis controlfont-familyโ choosing the family- Lesson: Web fonts