hide part of the text html, css, javascript

前端 未结 4 1603
迷失自我
迷失自我 2021-01-04 22:29

How to hide part of the text inside div or span ?

I have a text of 160 characters but I would like to display only first 40.

I ha

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-04 23:04

    You can use a simple css property for your element "text-overflow: ellipsis;" to use this property effectively you need to apply some related properties along with that.

    For Example:

    Some text goes here

    *Tested in Chrome.

提交回复
热议问题