CSS word ellipsis ('…') after one or two lines

前端 未结 9 2036
执笔经年
执笔经年 2021-01-01 23:40

I\'m trying to create a word-wrap in JavaScript using CSS, and the condition is:

If DIV contains one very long word, such as \"asdasfljashglajksgkjasghk

9条回答
  •  甜味超标
    2021-01-02 00:30

    Found this:

    http://codepen.io/martinwolf/pen/qlFdp

    Looks like -webkit-line-clamp works in some browsers.

提交回复
热议问题