Question
css text ellipsis one by one from right to left, instead of all at the same time
When I shrink the screen all elements become ellipsis. Is there a way to change this behavior? I want them to be ellipsis one by one from right to left. The third item should disappear first, the second - second, and then the first one.
I am open to changing the layout, as long as I can keep them in one row and align them in the middle vertically of the container (whatever they contain, this is why I used flexbox). If possible without JavaScript
.container {
display: flex;
align-items: center;
}
.item,
.inner {
/*without inner wrapper the text won't break into ellipsis, because of the .container flexbox*/
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
<div class="container">
<div class="item">
<div class="inner"> First item with long text </div>
</div>
<div class="item">
<div class="inner"> Second item with even longer text </div>
</div>
<div class="item">
<div class="inner"> Third item </div>
</div>
</div>
2 50
2