{ PS : i referred to Unable to get ellipsis for Multiline Paragraph }
Expected Output:
Focus with soft study music in
the background and make sure...
[after two lines, ellipsis is showing and text stops]
(https://i.stack.imgur.com/BeBdt.png)
..................................................................................................................................................................................
Obtained Output:
But after researching and checking many answers and tutorials I obtain the below result
I get this output with text flowing after the ellipsis
Focus with soft study music
in the background and make sure ...
it caters to all your needs.
....................................................................................................................................................................................
Main picture:
This is the css code
.text-tocut{
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
width:170px;
height: 60px;
font-size: 13px;
margin-bottom: 10px;
}
This is html code
<div class="sub-box">
<img class ="sub-image" src="thumbnails\c.jpg">
<img class="playsong-button" src="buttons\playsong-button.jpg">
<p class="sub-desc">
Instrumental Study
</p>
<p class="text-tocut">
Focus with soft study music in the background and make sure it caters to all your needs.
</p>
</div>
How do I get the output that I need? which is enter image description here
I thought we had to put the "para" into a div with a fixed width and height or make the para the child class and apply
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
also tried using text overflow, But, unfortunately, this didn't work either
I found similar question but none of them matched mine and I haven't found an answer so far