With CSS, use “…” for overflowed block of multi-lines

后端 未结 16 2352
情话喂你
情话喂你 2020-11-22 07:15

with

overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

\"...\" will be shown in the end of the line if overflowed. However, t

16条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 07:35

    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

    There also some preformance tests.

提交回复
热议问题