Skip to content

Files

Latest commit

 

History

History
25 lines (22 loc) · 789 Bytes

5e59460efa695ea9f7750152.md

File metadata and controls

25 lines (22 loc) · 789 Bytes
title date submitter number tags status related discussion
I want multi-line truncation via CSS
2020-02-28 16:55:42 UTC
Alexis Córdova
5e59460efa695ea9f7750152
css
in-progress
title url type
Line Clamp in CSS Overflow 3
draft

Single-line text truncation is easy, straightforward, and broadly supported in browsers; however, multi-line text truncation requires JavaScript, half-baked and non-standardized CSS properties, or fragile hacks to accomplish.

The closest attempt I've seen is the -webkit-line-clamp approach:

.line-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;  
}