VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-text-wrapping-and-overflow/

⇱ Bootstrap 5 Text wrapping and overflow - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Text wrapping and overflow

Last Updated : 23 Jul, 2025

Bootstrap 5 Text wrapping and overflow class is used to specify that the browser may break lines of text inside any targeted element to prevent overflow when the original string is too long to fit.

Bootstrap 5 Text wrapping and overflow Classes:

  • text-wrap: This class is used to wrap up the content.
  • text-nowrap: This class is used to not wrap the element.

Syntax:

<tag class="text-wrap">
 ...
</tag>

The below example illustrates the Text wrapping and overflow.

Example 1: In the following code, we will wrap the element.

Output:

👁 Image
Bootstrap 5 Text wrapping and overflow

Example 2: In the following code, we will not wrap the element.

Output:

👁 Image
Bootstrap 5 Text wrapping and overflow

Reference: https://getbootstrap.com/docs/5.0/utilities/text/#text-wrapping-and-overflow

Comment
Article Tags:

Explore