line-clamp
Limited availability97% of users
Limits the number of lines displayed in a block of text, automatically adding an ellipsis (...) at the end. It's the modern, non-prefixed way to do 'multiline truncation'.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in any major browser yet under this name.
The old way and the modern waySee the snippet: Multiline text truncation without JavaScript →
Old way 9 lines
/* JS: slice text, append '...'. */
/* or measure via getComputedStyle. Breaks on resize. */
/* CSS alone only truncates a single line */
.card-title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/* Older: -webkit-line-clamp + -webkit-box-orient */Modern 8 lines
.card-title {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
line-clamp: 3;
overflow: hidden;
}
/* Standard; -webkit- prefix still needed. */See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
none- Inherited
- No
- Applies to
- block containers except multi-column containers
- Animation type
- integer
Quick example
.card-excerpt {
display: -webkit-box;
-webkit-box-orient: vertical;
/* Standard property (supported in modern browsers) */
line-clamp: 3;
overflow: hidden;
}Values
noneRelated snippet
Multiline text truncation without JavaScriptTypography →line-clamp browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage97%of people can use this3% use a browser without it.
Interop 2027 candidate. Tracked for Interop 2027. Official focus areas publish early 2027; proposals are open through September 2026. See Interop 2027 →