Sometimes, we want to word-wrap text in HTML and CSS.
In this article, we’ll look at how to word-wrap text in HTML and CSS.
How to word-wrap text in HTML and CSS?
To word-wrap text in HTML and CSS, we set the word-wrap
property.
For instance, we write
div {
width: 200px;
word-wrap: break-word;
}
to add word-wrap: break-word;
to make words wrap by breaking the word if the content overflows a row in the div.
Conclusion
To word-wrap text in HTML and CSS, we set the word-wrap
property.