With CSS, use “…” for overflowed block of multi-lines

后端 未结 16 2670
情话喂你
情话喂你 2020-11-22 07:15

with

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

\"...\" will be shown in the end of the line if overflowed. However, t

16条回答
  •  生来不讨喜
    2020-11-22 07:26

    Great question... I wish there was an answer, but this is the closest you can get with CSS these days. No ellipsis, but still pretty usable.

    overflow: hidden;
    line-height: 1.2em;
    height: 3.6em;      // 3 lines * line-height
    

提交回复
热议问题