CSS | font-stretch Property

The font-stretch property in CSS is used to set the text wider or narrower. This property is not working any font. Its only work when font family has a width-variant face.

Syntax:

font-stretch: normal|ultra-condensed|extra-condensed|condensed|
semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded; 

Property Values:

  • normal: It is the default font face. It does not stretch the font.
  • ultra-condensed: It is used to specify font face more condensed than normal.
  • extra-condensed: It is used to set text narrower then normal and not narrower then ultra-condensed.
  • condensed: It is used to set text narrower then semi-condensed and not narrower then extra-condensed.
  • semi-condensed: It is used to set text narrower then normal and not narrower then semi-condensed.
  • semi-expanded: It is used to set text wider than normal, but not wider then expanded.
  • expanded: It is used to set text wider than semi-expended, but not wider then extra-expanded.
  • extra-expanded: It is used to set text wider than expended, but not wider then ultra-expanded.
  • ultra-expanded: It is used to set text wider than ultra-expended.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!--HTML code to illustrate font-stretch 
Property -->
<!DOCTYPE html>
<html>
    <head>
        <title>
            CSS font-stretch Property
        </title>
          
        <style>
            .normal {
                font-stretch: normal;
            }
              
            .ultra_condensed {
                font-stretch: ultra-condensed;
            }
              
            .extra_condensed {
                font-stretch: extra-condensed;
            }
              
            .condensed {
                font-stretch: condensed;
            }
              
            .extra_condensed {
                font-stretch: extra-condensed;
            }
              
            .semi_expanded {
                font-stretch: semi-expanded;
            }
              
            .expanded {
                font-stretch: expanded;
            }
              
            .extra_expanded {
                font-stretch: extra-expanded;
            }
              
            .ultra_expanded {
                font-stretch: ultra-expanded;
            }
        </style>
    </head>
      
    <body>
        <div class = "normal">
            GeeksforGeeks: A computer science portal
        </div>
          
        <div class = "ultra_condensed">
            GeeksforGeeks: A computer science portal
        </div>
          
        <div class = "extra_condensed">
            GeeksforGeeks: A computer science portal
        </div>
          
        <div class = "condensed">
            GeeksforGeeks: A computer science portal
        </div>
          
        <div class = "extra_condensed">
            GeeksforGeeks: A computer science portal
        </div>
          
        <div class = "semi_expanded">
            GeeksforGeeks: A computer science portal
        </div>
          
        <div class = "expanded">
            GeeksforGeeks: A computer science portal
        </div>
          
        <div class = "extra_expanded">
            GeeksforGeeks: A computer science portal
        </div>
          
        <div class = "ultra_expanded">
            GeeksforGeeks: A computer science portal
        </div>
    </body>
      
</html>                                    

chevron_right


Output:

Note: This property will not work on any font.

Supported Browsers: The browser supported by font-stretch property are listed below:

  • Google Chrome 48.0
  • Internet Explorer 9.0
  • Firefox 9.0
  • Opera 35.0
  • Safari 11.0


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.