解决数字不能换行问题

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以上版本使用样式解决.

posted on 2010-08-09 11:01  稻草人.Net  阅读(437)  评论(0编辑  收藏  举报