SOURCE

console 命令行工具 X clear

                    
>
console
 <div class="multiline-ellipsis">测试多行文本溢出省dsjkfhskjdghksjhgk略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试多行文本溢出省略测试<span class="test"></span></div>
.multiline-ellipsis {
	width: 100%;
    overflow: hidden;
    position: relative;
    line-height: 1.2em;
    max-height: 3.6em;
    text-align: justify;
    box-sizing: border-box;
}
/* create the ... */
.multiline-ellipsis:before {
      content: '...';
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 4;
}
/* hide ... if we have text, which is less than or equal to max lines */
.multiline-ellipsis:after {
    content: '';
    position: absolute;
    right: 0;
    width: 1em;
    height: 1.2em;
    margin-top: 0.2em;
    background: white;
    z-index: 2;
    bottom: 0;
}
.test {
	position: absolute;
	right: 0;
	background-color: white;
	z-index: 5;
	width: 1em;
    height: 1em;
}