On a few rare occasions, user generated/produced content could be needed to fill a small text box, be it on a user profile or elsewhere on a site. I have seen once or twice, the text that fills these boxes sometimes overspill the box its in generally because of user error. Though, even if the user fills in text too long for the box, the developer should prevision for this. An example below displays what can happen when content is too long for a div.
The text may be all rubbish in this example, but it still stands and can happen on live sites. Though CSS has a very nice feature which can fix this, word-break.
With word-break:break-all; the below screenshot is what happens to the text, the css automatically splits the word in 2 (or more) to stop it going outside of the div.
It’s a nice little property which should be remembered.