Open this example in the interactive library
Source code
<p class="demo line-clamp-2 max-w-[24ch]">
A long paragraph is still present in the markup. Only the first two lines fit
in this compact card.
</p>
Clamp a paragraph to two lines with Tailwind CSS 4 utilities. The preview uses precompiled styles.
Open this example in the interactive library
<p class="demo line-clamp-2 max-w-[24ch]">
A long paragraph is still present in the markup. Only the first two lines fit
in this compact card.
</p>