I have a bunch of display: inline-block;
divs inside of a display: flex;
parent div. When the window becomes too small, the parent div overflows the row and a horizontal scroll bar appears. One of the inline-block
divs contains some long content, so in this case I would like this block to collapse to overflow: ellipsis
. However, this block never technically overflows since it is the parent overflowing. How can I solve this?
Here is the code:
.outer {
display: flex;
flex-direction: row;
}
.inner {
display: inline-block;
flex: auto;
}
.overflowMe {
text-overflow: ellipsis;
}
<div class="outer">
<div class="inner">Content</div>
<div class="inner">Content</div>
<div class="inner overflowMe">Content</div>
<div class="inner">Content</div>
</div>
In this example, I would like the div with class overflowMe
to collapse and overflow before the outer
div overflows.
Pure css answers preferred but js is also acceptable.