text flowing out of div
When the text is without spaces and more than the div size 200px it's flowing out The width is defined as 200px I have put my code here http://jsfiddle.net/madhu131313/UJ6zG/ You can see the below pictures edited: I want the the text to go to the next line
Solution 1:
It's due to the fact that you have one long word without spaces. You can use the word-wrap
property to cause the text to break:
#w74 { word-wrap: break-word; }
It has fairly good browser support, too. See documentation about it here.
Solution 2:
Use
white-space: pre-line;
It will prevent text from flowing out of the div
. It will break the text as it reaches the end of the div
.
Solution 3:
You should use overflow:hidden;
or scroll
http://jsfiddle.net/UJ6zG/1/
or with php you could short the long words...