CSS-文本溢出省略号表示

前提条件是所引用的元素是块级元素,因为使用了WebKit的CSS扩展属性,该方法适用于WebKit浏览器及移动端

单行溢出处理:

.text-overflow{
    overflow: hidden;    
    text-overflow:ellipsis;    
    white-space: nowrap;
}

多行溢出处理:

.text-overflows{
    display: -webkit-box;    
    -webkit-box-orient: vertical;    
    -webkit-line-clamp: 3;    
    overflow: hidden;
}
原文地址:https://www.cnblogs.com/yangchin9/p/11199029.html