I have a <p>
tag with a specific width and height.
I want to use text-overflow:ellipsis
to get ...
if the text in the tag is too long.
Is this possible to solve with css on multiline text?
The text-overflow CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis (' … '), or display a custom string.
Yes, you can put them all in separate paragraphs, using the <p></p> tag or you can separate them via a <br> tag at every line.
To force overflow to occur and ellipses to be applied, the author must apply the nowrap value to the white-space property on the element, or wrap the content in a <NOBR> tag.
Googling doesn't reveal anything even remotely promising, so I'm going to say that it's not possible.
I did find text-overflow: -o-ellipsis-lastline
, but it only works in Opera: http://people.opera.com/dstorey/text/text-overflow.html (mirror: http://jsbin.com/exugux/)
There's also a similar WebKit-only solution: http://dropshado.ws/post/1015351370/webkit-line-clamp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With