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

前端 未结 9 1987
执笔经年
执笔经年 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:31

    For this you can use text-overflow: ellipsis; property. Write like this

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

提交回复
热议问题