UPDATE: Now that all browsers are up to speed, 9 times out of 10 div{word-wrap:break-word;} is going to be your easiest bet.
TextTextTextTextTextTextTextTextTextTextTextTextText<br> TextTextTextTextTextTextTextText
<?php $text = "TextTextTextTextTextTextTextTextTextText TextTextTextTextTextTextTextTextTextTextText"; $text = wordwrap($text, 52, "\n", 1); print $text; ?>
<p id="break">TextTextTextTextTextTextTextTextTextTextText TextTextTextTextTextTextTextTextTextText</p> <script type="text/javascript"> // The script MUST come after <p id="break"> String.prototype.breakAt=function(a){return this.substr (0,a)+'<br>'+this.substr(a)};var a=document.getElementById ('break');a.innerHTML=a.innerHTML.breakAt(52); </script>
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText
div { overflow:auto; }
div { word-wrap:break-word; }
<textarea readonly> TextTextTextTextTextTextTextTextTextTextTextTextTextText TextTextTextTextText </textarea>
<script type="text/javascript"> function limitText(textArea, length) { if (textArea.value.length > length) { textArea.value = textArea.value.substr(0,length); } } </script> <textarea onKeyPress="limitText(this,40);"></textarea>
<input type="text" maxlength="15">
Download From OnlineTools.org http://www.i-am-a-very-very-very-very-long-link.com
TextTextTextTextTextTextTextTextTextTextTextText​ TextTextTextTextTextTextTextText
TextTextTextTextTextTextTextTextTextTextTextText​ TextTextTextTextTextTextTextText
TextTextTextTextTextTextTextTextTextTextTextText­ TextTextTextTextTextTextTextText
TextTextTextTextTextTextTextTextTextTextTextText<wbr> TextTextTextTextTextTextTextText
span { float:left; } TextTextTextTextTextTextTextTextTextTextTextTextText <span>TextTextTextTextTextTextTextText</span>
<script type="text/javascript"> document.write('TextTextTextTextTextTextTextTextText\r\n TextTextTextTextTextTextTextText'); </script>
TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText |