Looking to set a maximum length for ellipsis on multiline text using CSS, I tried the following:
.body {
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
However, this approach did not work. Interestingly, when setting the style via Chrome DevTools on the selected element (element.style {}
), it does work.
Not Working:
Working:
Upon inspection, it appears that styles are added in both cases, but for some reason -webkit-box-orient: vertical;
is not added in the first one.
Any suggestions or help would be greatly appreciated.