对于div
1.(IE阅读器)white-space:normal; word-break:break-all;这里前者是遵循标准。
#wrap{white-space:normal; width:200px; }
或者
#wrap{word-break:break-all;width:200px;}
<div id="wrap">ddd111111111111111111111111111111</div>
效果:可以实现换行
2.(Firefox阅读器)white-space:normal; word-break:break-all;overflow:hidden;同样的FF下也没有很好的实现要领,只能潜藏或者加滚动条,当然不加滚动条效果更好!
#wrap{white-space:normal; width:200px; overflow:auto;}
或者
#wrap{word-break:break-all;width:200px; overflow:auto; }
<div id="wrap">ddd1111111111111111111111111111111111111111</div>
效果:容器正常,内容潜藏
对于table
1. (IE阅读器)运用样式table-layout:fixed;
<style>
.tb{table-layout:fixed}
</style>
<table class="tbl" width="80">
<tr><td>
abcdefghigklmnopqrstuvwxyz 1234567890
</td></tr>
</table>
效果:可以换行
http://www.knowsky.com/
2.(IE阅读器)运用样式
<style>
.tb {table-layout:fixed}
</style>
<table class="tb" width="80"><tr><td nowrap>
abcdefghigklmnopqrstuvwxyz 1234567890
</td></tr>
</table>
效果:可以换行
3. (IE阅读器)在运用百分比固定td大小情况下运用样式table-layout:fixed与nowrap
<style>
.tb{table-layout:fixed}
</style>
<table class="tb" width=80>