Skip to main content

Harshal V. LADHE

Multi-line Truncation with line-clamp

Clamping text to a set number of lines with `-webkit-line-clamp`, ending the last visible line with an ellipsis.

Content tagged line-clamp

  • Tutorial:Colouring a CSS text-overflow Ellipsis Separately from Its Text

    Give truncated text's ellipsis a colour of its own.
    Change the colour of a CSS text-overflow: ellipsis without faking it — the dots take their styles from the truncating container, so an inline span can colour the text separately. Covers the truncation basics, flex and grid items, multi-line line-clamp, detecting truncation in JavaScript, accessibility and common pitfalls.
    Published at:
    Categories:CSS
    Estimated reading time:11 min read