![]() |
VOOZH | about |
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.
<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