How-to articles, tricks, and solutions about WRAP

How Not to Wrap the Contents of <p>, <div>, and <span> Elements

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.

How to Disable Word Wrapping in HTML

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.

How to Wrap a Long String Without any Whitespace Character

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.

How to Wrap Text in a <pre> Tag with CSS

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.

How to Wrap the Content of a Table Cell

In this tutorial, we’ll demonstrate how to wrap the content of a table cell. For that, you need to use either the CSS word-wrap or word-break property.

How to Wrap Words in a <div> Tag with 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.