css省略号在第二行 [英] css ellipsis on second line
问题描述
CSS text-overflow:ellipsis
在第二行,这是可能的吗?我不能在网上找到它。
CSS text-overflow: ellipsis
on second line, is this possible? I can't find it on the net.
例如:
我想要的是这样: / p>
what I want is like this:
I hope someone could help me. I need
an ellipsis on the second line of...
但是发生了什么:
I hope someone could help me. I ...
推荐答案
text-overflow:ellipsis;
工作是 white-space的单行版本
( pre
,
nowrap
等)。这意味着文本永远不会到达第二行。
A requirement for text-overflow: ellipsis;
to work is a one-line version of white-space
(pre
, nowrap
etc). Which means the text will never reach the second line.
Ergo。在纯CSS中不可能。
Ergo. Not possible in pure CSS.
当我正在寻找完全相同的东西时,我的来源: http://www.quirksmode.org/css/textoverflow.html (Quirksmode ftw!)
My source when I was looking for the exact same thing just now: http://www.quirksmode.org/css/textoverflow.html (Quirksmode ftw!)
编辑如果好的CSS神将实现 http://www.w3.org/我们可以使用碎片
(new)和 max-行
(新)。另外,有关 http://css-tricks.com/line-clampin/ 的更多信息
EDIT If the good CSS gods will implement http://www.w3.org/TR/css-overflow-3/#max-lines we can haz this in pure CSS using fragments
(new) and max-lines
(new). Also some more info on http://css-tricks.com/line-clampin/
编辑2 WebKit / Blink有线夹
: -webkit-line- clamp:2
将省略号放在第二行。
EDIT 2 WebKit/Blink has line-clamp
: -webkit-line-clamp: 2
will put ellipsis on 2nd line.
这篇关于css省略号在第二行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!