Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any alternatives for "-webkit-box-orient"

Are there any alternatives for -webkit-box-orient?

I need it for the following class:

.max-2-lines{
    overflow: hidden;
   text-overflow: ellipsis;
   display: -webkit-box;
   -webkit-line-clamp: 2; /* number of lines to show */
   -webkit-box-orient: vertical;
}

However i can see here that only few browsers support that property

like image 700
Alberto Sinigaglia Avatar asked Oct 15 '25 03:10

Alberto Sinigaglia


1 Answers

Actually you are using the old implementation of line-clamp that require the use of -webkit-box and -webkit-box-orient.

In the near future you will only need to use the line-clamp property:

The line-clamp property is a shorthand for the max-lines, block-ellipsis, and continue properties.

It allows limiting the contents of a block container to the specified number of lines; remaining content is fragmented away and neither rendered nor measured. Optionally, it also allows inserting content into the last line box to indicate the continuity of truncated/interrupted content. ref

You can also check the Legacy compatibility section for more information

like image 120
Temani Afif Avatar answered Oct 17 '25 19:10

Temani Afif