是否可以在多行文本上使用文本溢出:省略号?
问题描述:
我有一个 p -tag与特定宽度和高度。如果标记中的文本太长,我想使用 text-overflow:ellipsis 来获取 ...
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?
答
Google搜寻并没有揭示任何远端有效的内容,
Googling doesn't reveal anything even remotely promising, so I'm going to say that it's not possible.
我发现 text-overflow:-o-ellipsis-lastline 但仅适用于Opera : http://people.opera.com/ dstorey / text / text-overflow.html (镜像: http://jsbin.com/exugux/ )
还有一个类似的WebKit解决方案: http:// dropshado.ws/post/1015351370/webkit-line-clamp
There's also a similar WebKit-only solution: http://dropshado.ws/post/1015351370/webkit-line-clamp