单行文本超出省略:
display:block;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
多行文本超出部分省略显示:
overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
此方法是不是很规范,也可用下面这种方法:
p { position:relative; line-height:1.4em; /* 3 times the line-height to show 3 lines */ height:4.2em; overflow:hidden; } p::after { content:"..."; font-weight:bold; position:absolute; bottom:0; right:0; }