CSS to achieve single-line and multi-line text omitted

Single text omitted

Many times uncertain word limit, but may affect the overall design of the new line, this time is commonly omitted text plus full text suggests

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

Multi-line text omitted

.dom{
 overflow: hidden;
-webkit-line-clamp: 3; 
-webkit-box-orient: vertical;
display: -webkit-box;

}

Guess you like

Origin www.cnblogs.com/yaohe/p/11057636.html