CSS · Properties — CSS Overflow

line-clamp

The CSS line-clamp property. Initial value: none. Not inherited.

Syntax
line-clamp: none | <integer>

Example

Try it

Notes

Media: visual. Applies to: blockContainersExceptMultiColumnContainers. Computed value: asSpecified.

More in this group

max-lines overflow-block overflow-clip-margin overflow-inline overflow-x overflow-y scroll-axis-lock scroll-behavior

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course