1.text {
2 overflow: hidden;
3 text-overflow: ellipsis;
4 display: -webkit-box;
5 -webkit-line-clamp: 2; /* number of lines to show */
6 -webkit-box-orient: vertical;
7}
1.class{
2 word-break: break-word;
3 overflow: hidden;
4 text-overflow: ellipsis;
5 display: -webkit-box;
6 line-height: 16px; /* fallback */
7 max-height: 32px; /* fallback */
8 -webkit-line-clamp: 2; /* number of lines to show */
9 -webkit-box-orient: vertical;
10}
1body {
2 margin: 20px;
3}
4
5.text {
6 overflow: hidden;
7 text-overflow: ellipsis;
8 display: -webkit-box;
9 -webkit-line-clamp: 2; /* number of lines to show */
10 -webkit-box-orient: vertical;
11}
1.className{
2 overflow: hidden;
3 text-overflow: ellipsis;
4 display: -webkit-box;
5 -webkit-line-clamp: 2;
6 -webkit-box-orient: vertical;
7
8 line-height: 16px; /* Height taken by one line */
9 max-height: 32px; /* (line-height * numberOfLineYouWant) In this case we want 2 lines so we will multiply lineHeight by 2 so 16 * 2 = 32 => 32px */
10 /* Remember if you have more height then it'll render new line so match height of container with => lineHeight * numberOfLines */
11}