Show only first two rows from a paragraph

后端 未结 4 814
我在风中等你
我在风中等你 2021-01-15 15:09

I need to display some text on two lines, and add some \"...\" if the text is too long.

Example :

This is some long text and we need to show it on only two         


        
4条回答
  •  别那么骄傲
    2021-01-15 15:56

    text-overflow works on some browsers -> http://www.quirksmode.org/css/textoverflow.html

    or

    Excellent answer here -> Insert ellipsis (...) into HTML tag if content too wide

    or

    To just limit the showing of 2 lines -> jTruncate jQuery plugin works well

提交回复
热议问题