使用 CSS,使用“...";对于溢出的多行块 [英] With CSS, use "..." for overflowed block of multi-lines
本文介绍了使用 CSS,使用“...";对于溢出的多行块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
与
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"..." 如果溢出,将显示在行尾.但是,这将仅显示在一行中.但我希望它以多行显示.
"..." will be shown in the end of the line if overflowed. However, this will be shown only in one line. But I would like it to be shown in multi-lines.
它可能看起来像:
+--------------------+
|abcde feg hij dkjd|
|dsji jdia js ajid s|
|jdis ajid dheu d ...|/*Here it's overflowed, so "..." is shown. */
+--------------------+
推荐答案
还有几个 jquery 插件可以解决这个问题,但很多都不能处理多行文本.以下作品:
There are also several jquery plugins that deal with this issue, but many do not handle multiple lines of text. Following works:
- http://pvdspek.github.com/jquery.autoellipsis/
- http://dotdotdot.frebsite.nl/
- http://keith-wood.name/more.html
- http://github.com/tbasse/jquery-truncate
还有一些性能测试.
这篇关于使用 CSS,使用“...";对于溢出的多行块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文