一般文字截断:
.text-overflow{
display:block;/*内联对象需加*/
width:3.1em;
word-break:keep-all;/*不换行*/
white-space:nowrap;/*不换行*/
overflow:hidden;
text-overflow:ellipsis;/*和下面的overflow一起使用*/
overflow:hidden;/*和上面的text-overflow一起使用*/
}
表格文字溢出:
table{
table-layout:fixed;/*只有定义了表格的布局算法为fixed,td的定义才能起作用*/
}
td{
width:100%;
word-break:keep-all;
white-space:nowrap;
overflow:hidden;/*内容超出宽度隐藏部分*/
text-overflow:ellipsis;
overflow:hidden;
}