Text Overflow Ellipsis on Multiple Lines
While CSS rules can effectively truncate text with ellipsis when it exceeds specified boundaries, achieving this same effect on multiple lines can be challenging. However, using a combination of CSS properties makes it possible.
To achieve an ellipsis on multiple lines, the following approach can be employed:
display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
Here's how these properties work:
Using these properties, text can be elegantly truncated on multiple lines, providing a clear and concise display.
The above is the detailed content of How Can I Create a Multi-Line Text Overflow Ellipsis with CSS?. For more information, please follow other related articles on the PHP Chinese website!