What is the CSS font-stretch property?
The font-stretch property in
This property has no effect if the selected font does not offer expanded or condensed typefaces.
Syntax
font-stretch: ultra-condensed|extra-condensed|condensed|semi-condensed|normal|semi-expanded|expanded|extra-expanded|ultra-expanded|initial|inherit;
Property values
-
normal: The default value that is used to specify that there is no font stretching. -
ultra-condensed: Makes the text as narrow as it can get. -
extra-condensed: Makes the text narrower thancondensedbut not as narrow asultra-condensed. -
condensed: Makes the text narrower thansemi-condensed, but not as narrow asextra-condensed. -
semi-condensed: Makes the text narrower thannormal, but not as narrow ascondensed. -
semi-expanded: Makes the text wider than normal, but not as wide asexpanded. -
expanded: Makes the text wider thansemi-expanded, but not as wide asextra-expanded. -
extra-expanded: Makes the text wider thanexpanded, but not as wide asultra-expanded. -
ultra-expanded: Makes the text as wide as it can get. -
initial: Sets thefont-stretchproperty to its default value. -
inherit: Inherits the property from its parent value.
Code
The basic font-stretch property is as follows:
In this example, we write some of the font-stretch properties and apply the corresponding property to them to show how the font will look in each property. We can also set the font-stretch property values according to our own choice.