|
|
|
|
|
by blago
5480 days ago
|
|
I agree, it would be a lot more useful. Safari has an unsupported property (-webkit-line-clamp) that goes a little further but still limited. The fact that none of the browsers provides a way (no even vendor-prefixed) to do it makes me think that there are big technical hurdles. I needed this desperately for a project I worked on last fall and ended up writing tons of JS which felt oh so wrong. Newspapers and magazines would LOVE to have that. Especially on mobile Safari. Especially on tablets. |
|
When you get into fancier concepts like truncating a set of lines, or only at certain word/phrase/sentence boundaries, you're into desktop publishing typesetting. To do that properly you're not just truncating when the container overflows, you're also adjusting the spacing between words and letters to make every line look consistent and to get as much of the text to fit neatly as you can. There aren't many pieces of software that professionals trust to do that well, and the ones that exist are expensive. We're not likely to see those algorithms getting into everyone's browser.