Bootstrap Text
Documentation and examples for common text utilities to control alignment, wrapping, weight, and more.
Text alignment
Easily realign text to components with text alignment classes. For start, end, and center alignment, responsive classes are available that use the same viewport width breakpoints as the grid system.
Start aligned text on all viewport sizes.
Center aligned text on all viewport sizes.
End aligned text on all viewport sizes.
Start aligned text on viewports sized SM (small) or wider.
Start aligned text on viewports sized MD (medium) or wider.
Start aligned text on viewports sized LG (large) or wider.
Start aligned text on viewports sized XL (extra-large) or wider.
Note that we don’t provide utility classes for justified text. While, aesthetically, justified text might look more appealing, it does make word-spacing more random and therefore harder to read.
Text wrapping and overflow
Wrap text with a .text-wrap class.
Prevent text from wrapping with a .text-nowrap class.
Word break
Prevent long strings of text from breaking your components’ layout by using .text-break to set word-wrap: break-word and word-break: break-word . We use word-wrap instead of the more common overflow-wrap for wider browser support, and add the deprecated word-break: break-word to avoid issues with flex containers.
Note that breaking words isn’t possible in Arabic, which is the most used RTL language. Therefore .text-break is removed from our RTL compiled CSS.
Text transform
Transform text in components with text capitalization classes.
Note how .text-capitalize only changes the first letter of each word, leaving the case of any other letters unaffected.
Font size
Quickly change the font-size of text. While our heading classes (e.g., .h1 – .h6 ) apply font-size , font-weight , and line-height , these utilities only apply font-size . Sizing for these utilities matches HTML’s heading elements, so as the number increases, their size decreases.
Customize your available font-size s by modifying the $font-sizes Sass map.
Font weight and italics
Quickly change the font-weight or font-style of text with these utilities. font-style utilities are abbreviated as .fst-* and font-weight utilities are abbreviated as .fw-* .
Bolder weight text (relative to the parent element).
Normal weight text.
Light weight text.
Lighter weight text (relative to the parent element).
Text with normal font style
Line height
Change the line height with .lh-* utilities.
Some placeholder content to show off the line height utilities. Happy birthday. You could’ve been the greatest. She ride me like a roller coaster. I messed around and got addicted. You just gotta ignite the light and let it shine! I’m intrigued, for a peek, heard it’s fascinating. Catch her if you can. I should’ve told you what you meant to me ‘Cause now I pay the price. Do you ever feel, feel so paper thin.
But you better choose carefully. Yo, shout out to all you kids, buying bottle service, with your rent money. She’s sweet as pie but if you break her heart. Just own the night like the 4th of July! In another life I would be your girl. Playing ping pong all night long, everything’s all neon and hazy. Shorty so bad, I’m sprung and I don’t care.
I can feel a phoenix inside of me. Maybe a reason why all the doors are closed. We go higher and higher. Passport stamps, she’s cosmopolitan. Someone said you had your tattoo removed. All my girls vintage Chanel baby. Someone said you had your tattoo removed.
But I will get there. This is real so take a chance and don’t ever look back, don’t ever look back. You could travel the world but nothing comes close to the golden coast. Of anything and everything. Venice beach and Palm Springs, summertime is everything. Do you ever feel already buried deep six feet under? It’s time to bring out the big balloons. So cover your eyes, I have a surprise. So I don’t have to say you were the one that got away.
Monospace
Change a selection to our monospace font stack with .font-monospace .
This is in monospace
Reset color
Reset a text or link’s color with .text-reset , so that it inherits the color from its parent.
Bootstrap 5 как увеличить шрифт
Documentation and examples for common text utilities to control alignment, wrapping, weight, and more.
Text alignment
Easily realign text to components with text alignment classes. For start, end, and center alignment, responsive classes are available that use the same viewport width breakpoints as the grid system.
Start aligned text on all viewport sizes.
Center aligned text on all viewport sizes.
End aligned text on all viewport sizes.
Start aligned text on viewports sized SM (small) or wider.
Start aligned text on viewports sized MD (medium) or wider.
Start aligned text on viewports sized LG (large) or wider.
Start aligned text on viewports sized XL (extra-large) or wider.
Text wrapping and overflow
Wrap text with a .text-wrap class.
Prevent text from wrapping with a .text-nowrap class.
Word break
Prevent long strings of text from breaking your components’ layout by using .text-break to set word-wrap: break-word and word-break: break-word . We use word-wrap instead of the more common overflow-wrap for wider browser support, and add the deprecated word-break: break-word to avoid issues with flex containers.
Text transform
Transform text in components with text capitalization classes.
Note how .text-capitalize only changes the first letter of each word, leaving the case of any other letters unaffected.
Font size
Quickly change the font-size of text. While our heading classes (e.g., .h1 – .h6 ) apply font-size , font-weight , and line-height , these utilities only apply font-size . Sizing for these utilities matches HTML’s heading elements, so as the number increases, their size decreases.
Customize your available font-size s by modifying the $font-sizes Sass map.
Font weight and italics
Quickly change the font-weight or font-style of text with these utilities. font-style utilities are abbreviated as .fst-* and font-weight utilities are abbreviated as .fw-* .
Bolder weight text (relative to the parent element).
Normal weight text.
Light weight text.
Lighter weight text (relative to the parent element).
Text with normal font style
Line height
Change the line height with .lh-* utilities.
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.
Monospace
Change a selection to our monospace font stack with .font-monospace .
This is in monospace
Reset color
Reset a text or link’s color with .text-reset , so that it inherits the color from its parent.
Muted text with a reset link.
Text decoration
Decorate text in components with text decoration classes.
This text has a line underneath it.
This text has a line going through it.
Variables
Font-size utilities are generated from this map, in combination with our utilities API.
Bootstrap 5 Typography Responsive font sizes
In Bootstrap 5 Typography, the font size is responsive dynamically to the different devices and viewport sizes. In Bootstrap Responsive Font Sizes unit resizing engine is used to resize font sizes. Responsive sizing is applied to classes that deal with the sizing of the text like heading classes and display heading classes and not to typography lead, inline text elements, etc.
Bootstrap 5 Typography Responsive font sizes classes: No special classes are used in Typography Responsive font sizes. You can customize the component using the classes of Typography.
Syntax:
Example 1: This code example shows how the Typography Responsive font sizes work on headings and display headings:
Bootstrap 5 Text/Typography
Bootstrap 5 uses a default font-size of 1rem (16px by default), and its line-height is 1.5.
In addition, all <p> elements have margin-top: 0 and margin-bottom: 1rem (16px by default).
<h1> — <h6>
Bootstrap 5 styles HTML headings ( <h1> to <h6> ) with a bolder font-weight and a responsive font-size.
Example
You can also use .h1 to .h6 classes on other elements to make them behave as headings if you want:
Example
Display Headings
Display headings are used to stand out more than normal headings (larger font-size and lighter font-weight), and there are six classes to choose from: .display-1 to .display-6 :
Example
Display 1
Display 2
Display 3
Display 4
Display 5
Display 6
<small>
In Bootstrap 5 the HTML <small> element (and the .small class) is used to create a smaller, secondary text in any heading:
Example
Bootstrap 5 will style <mark> and .mark with a yellow background color and some padding:
Example
Use the mark element to highlight text.
Bootstrap 5 will style the HTML <abbr> element with a dotted border bottom and a cursor with question mark on hover:
Example
<blockquote>
Add the .blockquote class to a <blockquote> when quoting blocks of content from another source. And when naming a source, like «from WWF’s website», use the .blockquote-footer class:
Example
Bootstrap 5 will style the HTML <dl> element in the following way:
Example
Bootstrap 5 will style the HTML <code> element in the following way:
Example
Bootstrap 5 will style the HTML <kbd> element in the following way:
Example
Bootstrap 5 will style the HTML <pre> element in the following way:
Example
More Typography Classes
The Bootstrap 5 classes below can be added to style HTML elements further: