VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-buttons-disable-text-wrapping/

⇱ Bootstrap 5 Buttons Disable text wrapping - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Buttons Disable text wrapping

Last Updated : 31 Jul, 2024

Bootstrap 5 Buttons Disable text wrapping is used if you don't want to wrap the button text. To disable the button text wrapping, we will use .text-nowrap class with .btn class. You can also use $btn-white-space: nowrap in SASS to disable text wrapping in each button.

Buttons Disable text wrapping used Class:

  • .text-nowrap: This class is used to disable the text wrapping of a button.

Syntax:

<button type="button" class="btn text-nowrap">
...
</button>

Example 1: In this example, we will use .btn, .btn-primary, and .text-nowrap classes to disable the text wrapping of a primary color button.

Output:

Example 2: In this example, we will use .btn, .btn-primary, and .text-nowrap classes and the disabled attribute to disable the text wrapping of the disabled outline success color button.

Output:

Reference:https://getbootstrap.com/docs/5.0/components/buttons/#disable-text-wrapping

Comment

Explore