function toBreakWord(intLen, id){
     var obj=document.getElementById(id);
     var strContent=obj.innerHTML; 
     var strTemp="";
     while(strContent.length>intLen){   
     strTemp+=strContent.substr(0,intLen)+"<br>";    
     strContent=strContent.substr(intLen,strContent.length); }
     strTemp+= strContent;obj.innerHTML=strTemp;
}

.br{word-break:break-all;word-warp:break-word;background-color:#eee;}

 

FF3.6以上版本使用样式解决.

相关文章:

  • 2021-08-09
  • 2021-11-17
  • 2021-07-21
  • 2022-12-23
  • 2021-06-30
  • 2022-03-02
  • 2022-03-12
  • 2022-12-23
猜你喜欢
  • 2022-01-07
  • 2021-11-28
  • 2021-12-22
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案