Foundations

Line Clamp

Use line clamp classes to limit long text to a fixed number of lines. Choose the tab that matches your starter.

Base class

Bootstrap line clamp needs this base class to hide overflow and enable line clamping.

ClampClassUse
Base.kf-line-clampAdds the line clamp behavior

Line count classes

Add one line count class with the base class.

ClampClassUse
1 line.kf-line-clamp-1Sets the clamp to 1 line
2 lines.kf-line-clamp-2Shows 2 lines
3 lines.kf-line-clamp-3Shows 3 lines
4 lines.kf-line-clamp-4Shows 4 lines
5 lines.kf-line-clamp-5Shows 5 lines
6 lines.kf-line-clamp-6Shows 6 lines

Preview

This preview uses a 3-line clamp.

KitFront line clamp utilities limit long content to a fixed number of lines while keeping the original text available in the HTML. KitFront line clamp utilities limit long content to a fixed number of lines while keeping the original text available in the HTML.

Use line clamp

Add .kf-line-clamp and the line count class.

<p class="kf-line-clamp kf-line-clamp-3">
  Long text content goes here.
</p>

Change line count

Keep .kf-line-clamp and replace only the line count class.

<!-- 2 lines -->
<p class="kf-line-clamp kf-line-clamp-2">...</p>

<!-- 4 lines -->
<p class="kf-line-clamp kf-line-clamp-4">...</p>

Section Used

...

Sections copied so far!