JSFiddle - React, Tailwind, and code Playground
HTML
<span>Hello World Foo Bar Baz is Carpe Diem and Bar Foo Blah What da heck !!!</span>
CSS
span {
background-color: red;
width: 100px;
/*height: 50px;*/
height:2.4em;
display: block;
overflow: hidden;
text-overflow: ellipsis;
/*white-space: nowrap; */
position:relative;
padding:0 0.5em;
}
span:after {
content:'...';
background:inherit;
position:absolute;
bottom:0;
right:0;
box-shadow:0 0 5px red
}
JavaScript
// the ellipsis should start right after the "is" in this case