text flowing out of div

madhu131313 picture madhu131313 · Aug 30, 2012 · Viewed 236.1k times · Source

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

enter image description here

enter image description here

Answer

chipcullen picture chipcullen · Aug 30, 2012

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.