1.一行显示,超出显示为省略号
.van-ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
2.两行显示,超出显示为省略号
.van-multi-ellipsis--l2 {
display: box;
overflow: hidden;
text-overflow: ellipsis;
line-clamp: 2;
box-orient: vertical;
}
3.三行显示,超出显示为省略号
.van-multi-ellipsis--l3 {
display: box;
overflow: hidden;
text-overflow: ellipsis;
line-clamp: 3;
box-orient: vertical;
}
4.总结
- 此为前端常用代码块