SOURCE

console 命令行工具 X clear

                    
>
console
<p class="multi-lines-text lines-1">aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccc</p>
<p class="multi-lines-text lines-2">aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccc</p>


<p class="multi-lines-text lines-3">aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccc</p>
<p class="multi-lines-text lines-3">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
<p class="multi-lines-text lines-3">aaaaaaa</p>

.multi-lines-text {
    width: 200px;
    word-break: break-all;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    border: 1px solid #d7d7d7;
    padding:5px;
}

.lines-1 {
    -webkit-line-clamp: 1;
}

.lines-2 {
    -webkit-line-clamp: 2;
}

.lines-3 {
    -webkit-line-clamp: 3;
}