转自:http://www.seezh.com/forums/viewtopic265.html
<style type="text/css">
<!--
/* 自动换行 */
.atuo_break_line {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
-->
</style>
<div class="atuo_break_line" style="width:80px">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
另外经测试在IE中只有div应用该样式效果完全正确,其他的用过<span>有的时候会失败。
本人用在解决Extjs4中ToolTips文字内容超过其宽度时的问题。