Languages
[Edit]
EN

CSS - text overflow ellipsis in vertical

8 points
Created by:
Isaiah89
721

In this article, we would like to show you how to use text overflow ellipsis in vertical mode in JavaScript.

Quick solution:

Note: the solution presented in the article uses -webkit-* style properties that may be not supported in some or older web browsers (versions released before 2019).

Simple preview:

Overflowing text cut in horizontal using CSS.
Overflowing text cut in horizontal using CSS.

Practical example

Edit

 

Legacy version

Edit

In this section, you can find solution that may be used when -webkit-box, -webkit-line-clamp or -webkit-box-orient are not supported. It makes last line gradient-transparent giving signal to the user the text is longer than visible area.

 

See also

Edit
  1. CSS - cut with dots (...) overflowing text outside element

References

Edit
  1. -webkit-line-clamp - MDN Docs

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join