日期:2014-05-17 浏览次数:20428 次
<div style="white-space:normal; width:200px; background-color:Yellow;">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
<body class="home" onload="toBreakWord(70)">
<script language="javascript" type="text/javascript">
function toBreakWord(intLen){
var obj=document.getElementById("change");
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;
}
</script>
------解决方案--------------------
楼主这样就可以啊 div限制了 宽度 文本内容不会超
------解决方案--------------------
------解决方案--------------------
不符合那个w3c的标准没有什么吧,最多是看着闹眼子吧了~
------解决方案--------------------
word-wrap:break-word;width:240px;
这个可以。
Fuck W3C All