Display can not be displayed in the form of ellipsis

When using css to realize that the text cannot be displayed, replace it with an ellipsis

1、

A single line of text:

 

overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
 display effect:

 


 

2. Multi-line text

display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3; /*Number of lines*/
overflow: hidden;

 display effect

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326417558&siteId=291194637