一、单行溢出
必须得有 width
width:300px;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
二、多行溢出
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
- -webkit-box-orient: 排列方式
- -webkit-line-clamp: 一个块元素显示的文本的行数
友情链接:链接