In this snippet, we want to demonstrate how you can make the contents of the <p>, <div>, and <span> elements not to wrap. Use the CSS white-space property.
In this snippet, we’re going to demonstrate how you can disable word wrapping. For that, use the white-space property either with the “nowrap” or “pre” value.
In this snippet, we’ll demonstrate how to wrap a long string without any whitespace character. Use the CSS word-wrap property with the “break-word” value.
The <pre> tag inserts a preformatted text into an HTML document. Since the <pre> tag doesn’t support wrapping, we’ll show how to do it with the help of CSS.
If you’ve faced the situation when you need to wrap long words in a <div>, use the white-space property with the “pre-wrap” value and word-wrap property.