How to disable line-break after a hyphen with HTML?

Spread the love

Sometimes, we want to disable line-break after a hyphen with HTML.

In this article, we’ll look at how to disable line-break after a hyphen with HTML.

How to disable line-break after a hyphen with HTML?

To disable line-break after a hyphen with HTML, we use the white-space CSS property.

For instance, we write

<span style="white-space: nowrap"></span>

to add the white-space: nowrap style to the span to make stop its content from wrapping to the next line.

Conclusion

To disable line-break after a hyphen with HTML, we use the white-space CSS property.

Leave a Reply

Your email address will not be published.