The number can be the container is large, can not be based on the size of the container to automatically wrap, the following is how CSS will wrap their way!
For Div
1. (ie browser) white-space:normal; Word-break:break-all; The former follows the standard.
#wrap {white-space:normal; width:200px;}
Or
#wrap {word-break:break-all;width:200px;}
<div id= "Wrap" >ddd1111111111111111111111111111111111</div>
Effect: line wrapping can be implemented
2. (Firefox browser) white-space:normal; Word-break:break-all;overflow:hidden, the same FF also does not have a good method of implementation, can only hide or add scroll bar, of course, no scroll bar effect better!
#wrap {white-space:normal; width:200px; overflow:auto;}
Or
#wrap {word-break:break-all;width:200px; overflow:auto;}
<div id= "Wrap" >ddd1111111111111111111111111111111111111111</div>
Effect: Container normal, content hidden
For table
1. (ie browser) using style table-layout:fixed;
<style>
. tb{table-layout:fixed}
</style>
<table class= "tbl" width= ">"
<tr>
<TD>ABCDEFGHIGKLMNOPQRSTUVWXYZ 1234567890
</td>
</tr>
</table>
Effect: can be changed line
2. (IE) using styles table-layout:fixed and nowrap
<style>
. TB {table-layout:fixed}
</style>
<table class= "TB" width= ">"
<tr>
<TD nowrap>abcdefghigklmnopqrstuvwxyz 1234567890
</td>
</tr>
</table>
Effect: can be changed line
3. (IE) use the style table-layout:fixed and nowrap in the case of fixed TD size using percentages
<style>
. tb{table-layout:fixed}
</style>
<table class= "TB" width=80>
<tr>
<TD width=25% nowrap>abcdefghigklmnopqrstuvwxyz 1234567890
</td>
<TD nowrap>abcdefghigklmnopqrstuvwxyz 1234567890
</td>
</tr>
</table>
Effect: Two TD all normal line break
4. (Firefox browser) use the style table-layout:fixed and nowrap with a percentage fixed TD size, and use div
<style>
. TB {table-layout:fixed}
. td {Overflow:hidden;}
</style>
<table CLASS=TB width=80>
<tr>
<TD width=25% CLASS=TD nowrap>
<DIV>ABCDEFGHIGKLMNOPQRSTUVWXYZ 1234567890</div>
</td>
<TD CLASS=TD nowrap>
<DIV>ABCDEFGHIGKLMNOPQRSTUVWXYZ 1234567890</div>
</td>
</tr>
</table>
Here the cell width must be defined as a percentage
Effect: normal display, but can not wrap (note: In the FF has not been able to make the container contents of a good way to wrap, can only use overflow to hide the content of the more, so as not to affect the overall effect)
For more related articles, please follow topic.alibabacloud.com (www.php.cn)!