.one-line {
display: -webkit-box;
overflow: hidden;
white-space: normal;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
/* 针对英文不会自动换行 */
word-wrap: break-word;
word-break: break-all;
}
.two-line {
display: -webkit-box;
overflow: hidden;
white-space: normal;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
/* 针对英文不会自动换行 */
word-wrap: break-word;
word-break: break-all;
}
还要加上元素的width,height,line-height