Use IE directly:
word-break:break-all; /*Allow line breaks within words*/
word-wrap:break-word; /*The content will wrap within the boundary*/
/*Required Note that the default is: */
word-wrap:normal /*Allow content to open the specified window boundary*/
However, Firefox does not have a good implementation method. A compromise solution is to use scroll bars, but A method of using js to determine line breaks has also been proposed on the Internet, which is excerpted here (reprinted from the Internet, hereby explained). JavaScript copy code
<script> <BR>function toBreakWord(intLen, id){ <BR> var obj=document.getElementById(id); <BR> var strContent=obj.innerHTML; <BR> var strTemp=""; <BR> while(strContent.length>intLen){ <BR> strTemp+=strContent.substr(0,intLen)+"<br>"; <BR> strContent=strContent.substr(intLen,strContent.length); <BR> } <BR> strTemp+= strContent; <BR> obj.innerHTML=strTemp; <BR>} <BR></script>
Note: The above script is placed in front of .
Single call on the same page: