I am trying to make a read more button like the picture above from YouTube. I don't need the collapsing functionality though, I only need visual properties.
<div class="card_short">
<h3 class="card_def">Here is long text.</h3>
<h3 class="read_more" style="color: #0057b3">Tap to read more.</h3>
</div>
I have a div as above. If these two texts combined exceeds 3 lines, I want the read_more text to be at the end of last line and card_def to either end with "..." before it or go under it. Here is the CSS code I tried but failed:
.article_short {
max-height: 65px;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.article_def {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
When I search for such thing, all results were about expanding-collapsing. I don't need it. I only need visuals, as read_more will be a link. I tried to understand YouTube's codes but it was too complicated for me.
On the other results stated to be related, it was only giving the ellipsis property of only one element. Unlike them, I need the read more button to be floating at the end of the 4th line.