Wulan’s batik description is too long for the catalogue card: write a one-line ellipsis or -webkit-line-clamp, and the browser answers which declarations it…
Why it matters
Truncation is on every card, list and preview: article titles, product descriptions, file names. One forgotten property means text running out or no ellipsis. Knowing the exact team keeps the layout tidy with no JS.
The key idea
An ellipsis takes a team of properties, one alone is not enough
Common mistakes
Only text-overflow: ellipsis, and no ellipsis shows Not enough alone: it needs white-space: nowrap and overflow: hidden. Without nowrap the text wraps, so no line overflows to be cut.
-webkit-line-clamp is set but the text still runs on It does nothing without display: -webkit-box and -webkit-box-orient: vertical. And without overflow: hidden, the remaining lines are still painted below.
A clamped element made a flex or grid container too An element has one display: display: flex overrides -webkit-box and the clamp is off. Put the clamp on a separate text element inside the flex/grid.
Try it in this playground
Open The missing ellipsis, then add the missing properties yourself The ellipsis only shows once the text may not wrap and its overflow is cut.
Change the -webkit-line-clamp number Try 1, 2, 4: the card’s height follows the number of lines, the ellipsis moves to the end of the last one.
Remove overflow: hidden from a clamp The box stays N lines, but the rest of the text is still painted and spills under the card.
Move font-size while a clamp is on The number of lines stays: a clamp counts lines, not pixel height like the max-height trick.