Hien's Home
View RSS feed

[Snippet] - CSS single and multi line text ellipsis

Published on

Single-line text ellipsis

1.single-line-ellipsis {
2 overflow: hidden;
3 white-space: nowrap;
4 text-overflow: ellipsis;
5}

Multi-line text ellipsis

1.multi-line-ellipsis {
2 overflow: hidden;
3 display: -webkit-box;
4 -webkit-box-orient: vertical;
5 -webkit-line-clamp: 3;
6}