I have a flexible 3-column layout, as you can see in this fiddle
Is there a way to tell the flex element an ellipse or break this long text? As you can see in the first column, I have a long word, if you resize the preview window, this column will break the layout of 3 columns. Are there other solutions?
Code (of the same fiddle) HTML:
<div class="container" > <div class="title"> LONG STRINGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG </div> <div class="tags"> <span class="place-tag" > Test </span> <span class="place-tag"> Test </span> <span class="place-tag"> Test </span> <span class="place-tag"> Test </span> <span class="place-tag"> Test </span> <span class="place-tag"> Test </span> <span class="place-tag"> Test </span> <span class="place-tag"> Test </span> <span class="place-tag"> Test </span> <span class="place-tag"> Test </span> <span class="place-tag"> Test </span> <span class="place-tag"> Test </span> </div> <div style="background-color:blue" > END </div> </div>
CSS
.container{ display: flex; flex-wrap: no-wrap; flex-direction: row; justify-content: space-around; } .title{ background-color:red; flex-grow:1; display:flex; flex-wrap:wrap; } .place-tag{ display:inline-block; } .tags{ background-color:green; flex-grow:1; flex-shrink:1; display:flex; justify-content:flex-end; flex-wrap:wrap; }
source share