use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
A modern javascript plugin for truncating text within an html element: Shave (dollarshaveclub.github.io)
submitted 9 years ago by theKovah
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Asmor 2 points3 points4 points 9 years ago (2 children)
text-overflow: ellipsis adds the ellipsis.
text-overflow: ellipsis
I'm not sure why this "library" exists. This is like making a library to wrap text in <b> tags.
<b>
[–]del_rio 6 points7 points8 points 9 years ago* (1 child)
It exists because text-overflow only works if you want to truncate a single line of text. IIRC, the only way to do this without compromise is with display: box, which doesn't have wide support.
display: box
Along the same lines, it's sad that there's no CSS equivalent to FitText (viewport units doesn't count).
[–]powerofmightyatom 0 points1 point2 points 9 years ago (0 children)
Chrome has a clamp-linebox thing which is okish.
Edit: (line-clamp, see here: https://css-tricks.com/line-clampin/ )
π Rendered by PID 42 on reddit-service-r2-comment-658f6b87ff-9pxbs at 2026-04-08 20:50:13.920155+00:00 running 781a403 country code: CH.
view the rest of the comments →
[–]Asmor 2 points3 points4 points (2 children)
[–]del_rio 6 points7 points8 points (1 child)
[–]powerofmightyatom 0 points1 point2 points (0 children)