
- CSS - Home
- CSS - Roadmap
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Types
- CSS - Measurement Units
- CSS - Selectors
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Border Block
- CSS - Border Inline
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursor
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS - Inline Block
- CSS - Dropdowns
- CSS - Visibility
- CSS - Overflow
- CSS - Clearfix
- CSS - Float
- CSS - Arrows
- CSS - Resize
- CSS - Quotes
- CSS - Order
- CSS - Position
- CSS - Hyphens
- CSS - Hover
- CSS - Display
- CSS - Focus
- CSS - Zoom
- CSS - Translate
- CSS - Height
- CSS - Hyphenate Character
- CSS - Width
- CSS - Opacity
- CSS - Z-Index
- CSS - Bottom
- CSS - Navbar
- CSS - Overlay
- CSS - Forms
- CSS - Align
- CSS - Icons
- CSS - Image Gallery
- CSS - Comments
- CSS - Loaders
- CSS - Attr Selectors
- CSS - Combinators
- CSS - Root
- CSS - Box Model
- CSS - Counters
- CSS - Clip
- CSS - Writing Mode
- CSS - Unicode-bidi
- CSS - min-content
- CSS - All
- CSS - Inset
- CSS - Isolation
- CSS - Overscroll
- CSS - Justify Items
- CSS - Justify Self
- CSS - Tab Size
- CSS - Pointer Events
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- CSS - Cascading
- CSS - Universal Selectors
- CSS - ID Selectors
- CSS - Group Selectors
- CSS - Class Selectors
- CSS - Child Selectors
- CSS - Element Selectors
- CSS - Descendant Selectors
- CSS - General Sibling Selectors
- CSS - Adjacent Sibling Selectors
- CSS Advanced
- CSS - Grid
- CSS - Grid Layout
- CSS - Flexbox
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Paged Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS - Image Sprites
- CSS - Important
- CSS - Data Types
- CSS3 Advanced Features
- CSS - Rounded Corner
- CSS - Border Images
- CSS - Multi Background
- CSS - Color
- CSS - Gradients
- CSS - Box Shadow
- CSS - Box Decoration Break
- CSS - Caret Color
- CSS - Text Shadow
- CSS - Text
- CSS - 2d transform
- CSS - 3d transform
- CSS - Transition
- CSS - Animation
- CSS - Multi columns
- CSS - Box Sizing
- CSS - Tooltips
- CSS - Buttons
- CSS - Pagination
- CSS - Variables
- CSS - Media Queries
- CSS - Functions
- CSS - Math Functions
- CSS - Masking
- CSS - Shapes
- CSS - Style Images
- CSS - Specificity
- CSS - Custom Properties
- CSS Responsive
- CSS RWD - Introduction
- CSS RWD - Viewport
- CSS RWD - Grid View
- CSS RWD - Media Queries
- CSS RWD - Images
- CSS RWD - Videos
- CSS RWD - Frameworks
- CSS References
- CSS Interview Questions
- CSS Online Quiz
- CSS Online Test
- CSS Mock Test
- CSS - Quick Guide
- CSS - Cheatsheet
- CSS - Properties References
- CSS - Functions References
- CSS - Color References
- CSS - Web Browser References
- CSS - Web Safe Fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
CSS - font-stretch Property
CSS font-stretch property makes text characters wider or narrower than the font's default character width.
Syntax
font-stretch: ultra-condensed | extra-condensed | condensed | semi-condensed | normal | semi-expanded | expanded | extra-expanded | ultra-expanded | percentage | initial | inherit;
Property Values
Value | Description |
---|---|
ultra-condensed | It makes the text as narrow as it gets. |
extra-condensed | It makes the text much narrower than condensed but less narrower than ultra-condensed. |
condensed | It makes the text narrower than semi-condensed but less narrower than extra-condensed. |
semi-condensed | It makes the text narrow compared to normal value. |
normal | No font stretching is done. Default value. |
semi-expanded | It makes the text wider compared to normal value. |
expanded | It makes the text wider than the semi-expanded but less wider than extra-expanded. |
extra-expanded | It makes the text wider than the expanded but less wider than ultra-expanded. |
ultra-expanded | It makes the text as wider as it gets. |
percentage | The stretch of the text is specified in percentage. |
initial | It sets the property to its initial value. |
inherit | It inherits the property from the parent element. |
Examples of CSS Font Stretch Property
The following examples explain the font-stretch property with different values.
Font Stretch Property with Normal Value
To not introduce any font stretch to the text, we use the normal value. This is the default value. These values have been used in the following example.
Example
<!DOCTYPE html> <html> <head> <style> @font-face { font-family: "LeagueMonoVariable"; src: url("https://mdn.github.io/shared-assets/fonts/LeagueMono-VF.ttf"); font-style: normal; } p { color: brown; font-weight: bold; font-family: "LeagueMonoVariable", sans-serif; } .ex1 { font-stretch: normal; } .ex2 { font-stretch: 150%; } </style> </head> <body> <h1> CSS font-stretch property </h1> <h4> font-stretch: normal, 150% </h4> <p class="ex1"> This text has normal font-stretch. </p> <p class="ex2"> This text has 150% font-stretch. </p> </body> </html>
Font Stretch Property with Different Condensed Values
To introduce a narrow stretch to the text, we can use the different variations of the condensed values which are: condensed, semi-condensed, extra-condensed and ultra-condensed. ultra-condensed is the narrowest while condensed is the least narrow, other values are in between these two. These values have been used in the following example.
Example
<!DOCTYPE html> <html> <head> <style> @font-face { font-family: "LeagueMonoVariable"; src: url("https://mdn.github.io/shared-assets/fonts/LeagueMono-VF.ttf"); font-style: normal; } p { color: red; font-weight: bold; font-family: "LeagueMonoVariable", sans-serif; } .condensed { font-stretch: condensed; } .semi-condensed { font-stretch: semi-condensed; } .extra-condensed { font-stretch: extra-condensed; } .ultra-condensed { font-stretch: ultra-condensed; } </style> </head> <body> <h1> CSS font-stretch property </h1> <h4> font-stretch: condensed, semi-condensed, extra-condensed, ultra-condensed </h4> <p class="condensed"> This text has condensed font-stretch. </p> <p class="semi-condensed"> This text has semi-condensed font-stretch. </p> <p class="extra-condensed"> This text has extra-condensed font-stretch. </p> <p class="ultra-condensed"> This text has ultra-condensed font-stretch. </p> </body> </html>
Font Stretch Property with Different Expanded Values
To introduce a wide stretch to the text, we can use the different variations of the expanded values which are: expanded, semi-expanded, extra-expanded and ultra-expanded. ultra-expanded is the widest while expanded is the least wide, other values are in between these two. These values have been used in the following example.
Example
<!DOCTYPE html> <html> <head> <style> @font-face { font-family: "LeagueMonoVariable"; src: url("https://mdn.github.io/shared-assets/fonts/LeagueMono-VF.ttf"); font-style: normal; } p { color: blue; font-weight: bold; font-family: "LeagueMonoVariable", sans-serif; } .expanded { font-stretch: expanded; } .semi-expanded { font-stretch: semi-expanded; } .extra-expanded { font-stretch: extra-expanded; } .ultra-expanded { font-stretch: ultra-expanded; } </style> </head> <body> <h1> CSS font-stretch property </h1> <h4> font-stretch: expanded, semi-expanded, extra-expanded, ultra-expanded </h4> <p class="expanded"> This text has expanded font-stretch. </p> <p class="semi-expanded"> This text has semi-expanded font-stretch. </p> <p class="extra-expanded"> This text has extra-expanded font-stretch. </p> <p class="ultra-expanded"> This text has ultra-expanded font-stretch. </p> </body> </html>
Font Stretch Property with Percentage Values
The font stretch of the text can also be given in percentage values (e.g. 100%, 50% etc.). Depending on the provided value, the stretch of the text will be affected. This is shown in the following example.
Example
<!DOCTYPE html> <html> <head> <style> @font-face { font-family: "LeagueMonoVariable"; src: url("https://mdn.github.io/shared-assets/fonts/LeagueMono-VF.ttf"); font-style: normal; } p { color: purple; font-weight: bold; font-family: "LeagueMonoVariable", sans-serif; } .ex1 { font-stretch: 150%; } .ex2 { font-stretch: 350%; } </style> </head> <body> <h1> CSS font-stretch property </h1> <h4> font-stretch: 150%, 350% </h4> <p class="ex1"> This text has 150% font-stretch. </p> <p class="ex2"> This text has 350% font-stretch. </p> </body> </html>
Note: If the font face you are using does not support condensed or expanded forms, the font-stretch property will have no effect.
Supported Browsers
Property | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
font-stretch | 48.0 | 9.0 | 9.0 | 11.0 | 35.0 |