CSS3 Vertical ellipsis
HTML
<div class="text">
<div>Lorem ipsum dolor sit amet, lorem ipsum dolor sit amet, lorem ipsum dolor sit amet lorem ipsum dolor sit amet, lorem ipsum dolor sit amet, lorem ipsum dolor sit amet</div>
<a href="#">More</a>
</div>
CSS
body {
margin: 20px;
}
.text {
display: inline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
line-height: 24px; /* fallback */
max-height: 48px; /* fallback */
-webkit-line-clamp: 2; /* number of lines to show */
-webkit-box-orient: vertical;
position: relative;
padding-bottom: 24px;
}
.text::before {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 24px;
background-color: #fff;
z-index: 1;
}
.text div {
background-color: #fff;
display: inline;
position: relative;
}
.text div::after {
content: "";
background-color: #fff;
position: absolute;
bottom: -24px;
left: 0;
width: 100%;
height: 24px;
z-index: 2;
}
.text a::before {
content: "More";
position: absolute;
bottom: 0;
left: 0;
text-decoration: underline;
z-index: 1;
}