How To Set Limit Of Text Lines Using Css

I am going to show you How To Set Limit Of Text Lines Using CSS.

Most of the times we need to make designs to limit the characters or text for the perfect designs.

So I am going to how you can limit the characters using CSS.

overflow: hidden;
white-space: normal;
text-overflow: ellipsis;
display: -webkit-box !important;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;

We need to use text-overflow: ellipsis

-webkit-line-clamp: 2; that defines how many lines we need to display.

If you want to display 3 lines then it will be -webkit-line-clamp: 2;

Hope this article will help you.

 

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe

Select Categories