Hello everyone, I have come across an issue. English is not my strong suit, but I will do my best to explain it thoroughly.
The problem at hand is a design requirement in the draft that specifies showing up to five lines of text. If the text exceeds this limit, a button should appear to expand and show more text! I am not very well-versed in JavaScript and know only a little bit about it. I was wondering if this effect can be achieved using CSS alone?
If you have any knowledge on how to implement this using JavaScript, please feel free to share it with me~ Thank you in advance for your assistance, as I am clueless about how to proceed. Thank you.
.content {
height: 110px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 5;
}
.more {
text-align: center;
}
.more a {
text-decoration: none;
color: #222;
}
<div class="demo">
<p class="content">
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Suscipit odit fugit debitis, quibusdam esse eius ullam odio cupiditate cumque nostrum asperiores libero, sapiente aliquid animi? Saepe eligendi doloremque possimus. Velit sunt earum aliquam debitis quos eum atque nemo eius, hic quas doloremque facere et voluptatibus voluptatum eaque corrupti impedit ipsum beatae incidunt sapiente aliquid animi? Saepe eligendi doloremque possimus. Velit sunt earum aliquam debitis quos eum atque nemo eius, hic quas doloremque facere et voluptatibus voluptatum eaque corrupti impedit ipsum beatae incidunt sapiente aliquid animi? Saepe eligendi doloremque possimus. Velit sunt earum aliquam debitis quos eum atque nemo eius, hic quas doloremque facere et voluptatibus voluptatum eaque corrupti impedit ipsum beatae incidunt
</p>
<div class="more">
<a href="javaScript:;" class="show">V</a>
</div>
</div>