多行文本溢出裁剪(兼容版)
-
常规(webkit内核)
.text-container { height: 100px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp:4; }
-
兼容性
利用
行级元素
环绕浮动元素的特点.text-container { height: 100px; overflow: hidden; } .content { line-height: 25px; margin-top:-80px; } .text-container::before{ content:''; height: 80px; display: block; } .more { float: right; }