Cross-browser multi-line text overflow with ellipsis appended within a fixed width and height

前端 未结 25 2849
栀梦
栀梦 2020-11-22 16:19

I made an image for this question to make it easier to understand.

Is it possible to create an ellipsis on a

with a fixed width and multiple
25条回答
  •  醉酒成梦
    2020-11-22 16:31

    not sure if this is what you're looking for, it uses min-height instead of height.

        
    $numb) { $text = substr($text, 0, $numb); $etc = "..."; $text = $text.$etc; } $text = htmlentities($text, ENT_QUOTES); return $text; } echo truncate("this is a multi-lines text block, some lines inside the div, while some outside", 63); ?>

提交回复
热议问题