css控制文字自动换行的实现方法

2020-05-02 07:40:25易采站长站整理

    
<h1><code>IE  word-wrap : break-word ;</code></h1>  
<div style="word-wrap : break-word ; width:200px;">abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>  
<h1><code>IE  word-break:break-all;</code></h1>  
<div style="word-break:break-all;width:200px;">abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div>  
    
<h1><code>Firefox/ word-break:break-all; overflow:auto;</code></h1>  
<div style="word-break:break-all; width:200px; overflow:auto;">abcdefghijklmnabcdefghijklmnabcdefghijkl   
mn111111111</div>  
<h1><code>table</code></h1>  
<h1><code>table-layout:fixed;</code></h1>  
<table style="table-layout:fixed" width="200">  
<tr>  
<td>abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td>  
</tr>  
</table>  
<h1><code>table-layout:fixed; word-break : break-all; word-wrap : break-word ;</code></h1>  
<table width="200" style="table-layout:fixed;">  
<tr>  
<td width="25%" style="word-break : break-all; ">abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td>  
<td style="word-wrap : break-word ;">abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td>  
</tr>  
</table>  
<h1><code>FF  table-layout:fixed; overflow:hidden;</code></h1>  
<table style="table-layout:fixed" width="200">  
<tr>  
<td width="25%"  style="word-break : break-all; overflow:hidden; ">abcdefghigklmnopqrstuvwxyz1234567890</td>  
<td width="75%" style="word-wrap : break-word; overflow:hidden; ">abcdefghigklmnopqrstuvwxyz1234567890</td>  
</tr>  
</table>  
</body>  
</html>  

以上就是小编为大家带来的css控制文字自动换行的实现方法全部内容了,希望大家多多支持软件开发网~