I have a situation where there can be long words like 'hellowordsometext' or integer like '1234567891122' without any space in between. check this js please. http://jsfiddle.net/rzq5e/6/
how is it possible to break it in to next line after it reach the div width. what happens now is, it spans out out along with th div
<div>Solutionforentprise</div>
What you need is
word-wrap: break-word;
, this property will force the non spaced string to break inside thediv
Demo
I have found this solution my self.
but it doesn't work for Opera.
http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_word-break
The other answers have some problems with old browsers, like before Chrome 32.
Its better to use this code:
You can also add a hyphen where the word breaks (if supported):
Source
Fix the size of the DIV and apply 'overflow: hidden' so it will not effect the grid size an all na.
do you need to view entire text?
give an id or class to your div
then
Word-wrap is supported in IE 5.5+, Firefox 3.5+, and WebKit browsers such as Chrome and Safari, Opera 10.5+.
Like this
DEMO
CSS