与
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"..."如果溢出,将显示在行尾。 但是,这将仅显示在一行中。 但我希望它以多行显示。
它可能看起来像:
+--------------------+
|abcde feg hij dkjd|
|dsji jdia js ajid s|
|jdis ajid dheu d ...|/*Here it's overflowed, so "..." is shown. */
+--------------------+
最佳答案
还有几个 jquery 插件可以处理这个问题,但是很多不处理多行文本。以下作品:
- http://pvdspek.github.com/jquery.autoellipsis/
- http://dotdotdot.frebsite.nl/
- http://keith-wood.name/more.html
- http://github.com/tbasse/jquery-truncate
还有一些preformance tests .
关于html - 使用 CSS,将 "..."用于溢出的多行 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6222616/