Effect demonstration code:
]
CSS control forced line break/force Line break
Force no line break
div{
white-space:nowrap;
}
Automatic line break
div{
word-wrap: break- word;
word-break: normal;
}
Force English word line break
div{
word-break:break-all; }<script>
function toBreakWord(intLen){
var obj=document.getElementById("ff");
var strContent=obj.innerHTML;
var strTemp="";
while(strContent.length>intLen){
strTemp+=strContent.substr(0,intLen)+"
";
strContent=strContent.substr(intLen,strContent.length);
}
strTemp+="
"+strContent;
obj.innerHTML=strTemp;
}
if(document.getElementById && !document.all) toBreakWord(37)
</script>