CSS实现单行、多行文本溢出显示省略号的实现方法

1,单行溢出,超出部分显示...或者截取。前提必须有宽度。

width:300px;   
overflow: hidden;   
text-overflow:ellipsis;   
white-space: nowrap;

2.多行溢出

display: -webkit-box;   
-webkit-box-orient: vertical;   
-webkit-line-clamp: 3;   
overflow: hidden;

猜你喜欢

转载自blog.csdn.net/m0_67948827/article/details/127579852