CSS 实现文本的单行和多行溢出省略效
.textTruncate {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.mulLineTruncate {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.mulLineTruncate {
max-height: 40px;
overflow: hidden;
line-height: 20px;
}
.mulLineTruncate {
position: relative;
max-height: 40px;
overflow: hidden;
line-height: 20px;
&::after {
position: absolute;
right: 0;
bottom: 0;
padding: 0 20px 0 10px;
content: '...';
}