HTML truncate content based on div height

后端 未结 4 1897
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 21:21

I have a div with width of 130px a height of 200px.

Various text content gets displayed in this div (I\'ve written some JS to fade in and out differ

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-14 21:47

    Try this:

    .ellipsis{ 
      white-space: word;
      overflow:hidden;
    }
    
    .ellipsis:after{
      content:'...';
    }
    

提交回复
热议问题