questions

How to showing title on two lines in WP

Rate this post

Suppose I have a long title for some of my posts in my wordpress website.

Now I want to show those long titles in two lines either in desktop or laptop or mobile screen.

That means in all devices that long title shows in two line and then dot(…).

It is possible for specific character but how to do that for specific lines?

Anybody help please?

 

✔️Solution:

You can do this with css:

.my-long-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
    line-clamp: 2;
    overflow: hidden;
}

Leave a Reply

Your email address will not be published.

Back to top button