seniorCSS
How do you achieve multi-line truncation (line-clamp) in CSS?
Updated Apr 28, 2026
Short answer
Multi-line truncation requires a combination of outdated WebKit flexbox properties that have been globally adopted as a standard hack.
Deep explanation
Unlike single-line truncation (text-overflow: ellipsis), truncating text after exactly 'X' lines requires display: -webkit-box, -webkit-line-clamp, and -webkit-box-orient: vertical. A newer, cleaner standard (line-clamp) is in the spec but lacks full support.
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro