Home >Web Front-end >CSS Tutorial >How Can I Truncate Text on the Second Line Using CSS?
Original Question:
"How can I achieve text ellipsis specifically on the second line using CSS? Despite searching the internet, I've come up empty-handed."
Answer:
While CSS does not provide a direct way to truncate text on a specific line, you can achieve this effect in webkit browsers with the following CSS properties:
overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
Explanation:
Browser Support:
Note that this solution is only supported in webkit browsers, including Safari, Chrome, and Microsoft Edge.
The above is the detailed content of How Can I Truncate Text on the Second Line Using CSS?. For more information, please follow other related articles on the PHP Chinese website!