CSS Line Clamp Generator
Truncate multi-line text with a CSS-only ellipsis using -webkit-line-clamp. Set the number of lines, adjust font size and line height, and edit the preview text directly. The output includes all required declarations for cross-browser support.
Browser support
-webkit-line-clamp works in all modern browsers including Chrome, Firefox, Safari, and Edge.
Live preview — click to edit text
Showing 3 lines at 16px / 1.6 line-height. Clamp height ≈ 77px.
How to use
Set line count
Drag the slider to choose how many lines to show before the text is cut off with an ellipsis.
Adjust font settings
Match the font size and line height to your actual design so the preview is accurate.
Edit preview text
Click the preview area and type your real content to see exactly how truncation will look.
Copy CSS
The output includes all four required properties: display, -webkit-box-orient, -webkit-line-clamp, and overflow.