Incorrect Truncation of Text using CSS clamp

Viewed 38

I am using below css to truncate text but for some cases it truncate the text in middle. Not sure how the css clamp break the word -

overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;

Like below text was wrap to two lines and in line two it was truncated in middle not all the available space was occupied by the text.

Actual Text

TMX Actual Summary - Automobile Test

div width is 125px where this text was rendered.

Output

TMX Actual Summary -...

Expected Output

TMX Actual Summary - Au...

0 Answers
Related