Using line-clamp for Multi-Line Truncation in CSS


Clamp the number of lines of text, showing ellipsis (…) for overflow.

Source Code

.line-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Number of lines */
    -webkit-box-orient: vertical;  
    overflow: hidden;
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments