I know how to make a single div to put ellipsis after n number of lines using (where n is 2 lines in this case):
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
It works one one div
but I have a different problem. I have a title and a description of some content, and I want to limit both fields to 3 lines at max by themselves, but also a total of 5 lines (instead of the maximum possible, 6 in that case) in total. In other words, I'd like to cut description after two lines (with an ellipsis) if the title is 3 lines.
How do I achieve this (preferably with no or smallest amount of Javascript)? I only need to support (mobile) Safari for now.