使用CSS,请使用“...”用于多行的溢出块 [英] With CSS, use "..." for overflowed block of multi-lines

查看:109
本文介绍了使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆