Home >Web Front-end >CSS Tutorial >Truncating multiline text with line-clamp

Truncating multiline text with line-clamp

Linda Hamilton
Linda HamiltonOriginal
2024-12-29 10:44:12188browse

Truncating multiline text with line-clamp

line-clamp is a CSS property that allows you to truncating multiline text (cut off text) within an HTML element to a certain number of lines. It’s perfect for when you want to show only a part of long text, like titles, product descriptions or article excerpts, while keeping readability and looks.

See the following Codepen for a demo:

Full article: https://snippflow.com/snippet/truncating-multiline-text-with-line-clamp/
CSS Snippets

The above is the detailed content of Truncating multiline text with line-clamp. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn