Extracting a few sentences from a JSON file and displaying it in a <p>
tag.
<p>
Thank you all for another wonderful night spent together
this past Sunday at The Hippodrome in Baltimore. Thank yo...
<p>
I want to further shorten the displayed text, even though it has already been truncated in the JSON. Is it possible to limit its length using only pure CSS or HTML?
I am not looking for JavaScript/jQuery solutions since achieving this with JavaScript is straightforward by manipulating the DOM. I am exploring if there are any ways to achieve this using pure HTML and CSS.
UPDATE 1:
Many suggestions involve converting the sentences into a single line using white-space: nowrap
and hiding overflow text with text-overflow: ellipsis
. However, this approach limits the display to a single line. Are there alternative methods to display multiple lines of text?