软件下载 | 资讯教程 | 最近更新 | 下载排行 | 一键转帖 | 发布投稿
您的位置:最火下载站 > Web前端 > Html/css > IE与FF实现纯英文纯数字字符自动换行

IE与FF实现纯英文纯数字字符自动换行

IE与FF实现纯英文纯数字字符自动换行

来源:http://www.heiniuhaha.cn/blog/?p=1112

IE css code:

#test{
width:135px;
table-layout:fixed;
word-break: break-all;
overflow:hidden;
}

FF js code:

<!Doctype html>
<html>
<body>
<div id="test" style=";border-width:1px;border-color:#333;width:400px;word-wrap:break-word;">
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
777777777777777777777777777777777777777777779999999999999999990000000000000000
</div>
<SCRIPT>
function toBreakWord(intLen){
var obj=document.getElementById("test");
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;
}
if(document.getElementById && !document.all){toBreakWord(20);}
</SCRIPT>
</body>
</html>
    相关阅读
    栏目导航
    推荐软件