line-clamp
Limited availability
The line-clamp CSS property limits the text in a block container to a certain number of lines. The prefixed -webkit-line-clamp is widely supported but only works with -webkit-box-orient: vertical in combination with display: -webkit-box or display: -webkit-inline-box.
Browser support (view on caniuse.com)
Need this feature?
Leave a 👍 on the feedback issue
Don't forget to also leave a comment explaining your specific use case.
MDN documentation
Specifications
Web Platform Tests (WPT)
View the latest WPT test results for this featureSurveys
- State of CSS 2026 > usage > css interoperability features
- State of CSS 2026 > shapes graphics > shapes graphics pain points features
- State of CSS 2026 > shapes graphics > shapes graphics pain points
- State of CSS 2026 > layout > layout pain points features
- State of CSS 2026 > all features > all features
- State of CSS 2025 > usage > css interoperability features
- State of CSS 2025 > typography > typography pain points
- State of CSS 2025 > features > all features
- State of CSS 2024 > usage > css interoperability features
- State of CSS 2024 > features > all features
Developer use cases
-
Clamp user-entered text, in my case a page title, to a set number of lines with an ellipsis. The length can't be predicted or trimmed on the server, and the limit differs by viewport (two lines on desktop, three on phones).
Clamp user-entered text, in my case a page title, to a set number of lines with an ellipsis. The length can't be predicted or trimmed on the server, and the limit differs by viewport (two lines on desktop, three on phones). [see original comment]
View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist