I want the content of .main
to be limited to 5 lines and upon exceeding that, I want to show ellipsis.
.main {
width: 100px;
margin-bottom: 6px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 5;
-webkit-box-orient: vertical;
}
<div class="main">
<ul>
<li>hello1</li>
<li>hello2</li>
<li>hello3</li>
<li>hello4</li>
<ul>
<li>hello5</li>
<li>hello6</li>
<li>hello7</li>
<li>hello8</li>
</ul>
</ul>
</div>
This works as expected in Chrome and content ends with ellipsis after 5 line. But in Safari, no ellipsis is shown in the end. Also Safari is showing 6 lines instead of 5. Pls see following screenshot.
Does anyone has any suggestion on how to fix it in Safari?
Versions:
Chrome: Version 85.0.4183.121 (Official Build) (64-bit)
Safari: Version 13.1.2