1、多行文本
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
2、通过js代码设置
if (string.length > 26) {
string = string.substring(0, 23) + '...';
}
3、单行文本
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;