Skip to main content

Truncate Multi-line Text

Sep 20, 2019 • 1 min • TIL #2

This exact set of properties now actually works to do multiple-line truncation in a fairly well supported way.

.box p {
  display: -webkit-box;
  -webkit-line-clamp: 1; /* # of lines to truncate */
  -webkit-box-orientation: vertical;
  overflow: hidden;
}