Asked
Active
Viewed 1.7e+01k times
70

Jonathan Ivgi
- 777
- 1
- 5
- 10
-
2The key word you need to search for is "ellipsis" – DJClayworth Apr 15 '16 at 16:46
-
1http://www.mobify.com/blog/multiline-ellipsis-in-pure-css/ – j08691 Apr 15 '16 at 16:49
-
Check this link for Cross-browser multiline ellipse. https://codepen.io/natonischuk/pen/QbGWBa – Himanshu Shekhar Mar 25 '19 at 06:00
1 Answers
168
Add all these. To make in single line.
{
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
width:100px; /* some width */
}
To do in multi line which actually you asked.
#content {
overflow: hidden;
width:100px;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
working fiddle: https://jsfiddle.net/mishrarajesh/676jc7sa/
Please note that this multiline code is supported only in web-kit browsers for now.

Jakub Kurdziel
- 3,216
- 2
- 12
- 22

rajesh
- 2,354
- 1
- 12
- 15
-
4
-
1
-
@rajesh Is this css can be used in email format so i can make email responsive like your demo? – Bhavin Thummar Nov 02 '18 at 07:16
-
-
4
-
3This multiline version works only for webkit. At least answer should mention it. – Gherman Feb 26 '19 at 15:39
-