css realizes that the text content exceeds the hidden, and the ellipsis is displayed
- Single-line text: force the text not to wrap, and display an ellipsis for the excess
.text{
width: 100%;
height: 30px;
line-height: 30px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
- Multi-line text: the number of lines and height can be customized, and ellipsis will be displayed for the excess part
.multi-line {
max-height: 80px;
text-align: justify;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}