How do I make a text go onto the next line if it overflows?
CssCss Problem Overview
I tried word-wrap: break-word;
, but it separates lines mid word.
Css Solutions
Solution 1 - Css
In order to use word-wrap: break-word
, you need to set a width (in px). For example:
div {
width: 250px;
word-wrap: break-word;
}
word-wrap is a CSS3 property, but it should work in all browsers, including IE 5.5-9.
Solution 2 - Css
As long as you specify a width on the element, it should wrap itself without needing anything else.
Solution 3 - Css
word-wrap: break-word;
add this to your container that should do the trick