达到3条线时,这是我的CSS代码段使用文本溢出:省略号;只有在一个div
.test{
width:150px;
height:60px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
它是什么..
the quick brown fo...
我要的是
the quick brown fox
jumps over the lazy
dog. the quick br...
反正是有只用CSS来做这件事?或者我需要为此使用JavaScript。如果需要JavaScript,任何人都可以教我如何?谢谢!
UPDATE
我试图消除white-space: nowrap;
,并添加overflow-y: hidden;
它给我的3线布局,但没有省略号
.test{
width:150px;
height:60px;
overflow-y: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
不可能的......我用这个插件http://plugins.jquery.com/ellipsis/ – elclanrs 2013-04-26 06:11:46
我明白了,会尝试插件现在.. – galao 2013-04-26 06:13:29
把乌尔代码放在小提琴中,并发送你.. – PraJen 2013-04-26 06:20:54