Line clamp
Utilities for visually truncating text after a fixed number of lines.
Class reference
Usage
Use the line-clamp-{n}
utilities to specify how many lines of text should be visible before truncating:
To remove any line-clamping, use line-clamp-none
:
Note that the line-clamp-{n}
set other properties like display
and overflow
in addition to -webkit-line-clamp
which are not unset by line-clamp-none, so depending on what you are trying to achieve you may need to explicitly override those properties with utilities like flex
or overflow-visible
as well.
Responsive
To control the line-clamp at a specific breakpoint, add a {screen}:
prefix to any existing z-index utility. For example, use md:line-clamp-5
to apply the line-clamp-5
utility at only medium screen sizes and above.
For more information about Elements’ responsive design features, check out the Responsive Design documentation.
On this Page
v1.13.5