I have a three divs within a flex div. I'm trying to figure out how to prevent the middle div from moving/changing position when the text in the first or last div changes.
.container {
display: flex;
justify-content: space-between;
}
<div class="container">
<div clas="div1">Text1</div>
<div class="div2">Text2</div>
<div class="div3">Text3</div>
</div>
If Text3 is changed to something different, for example, AnotherText3, note that the center div (Text2) also moves (shifts to the left), I would like Text2 to stay centered and not move.
Text3 could be long in which case it should occupy the space between Text2 and Text3 (while still keeping Text2 in the center) and be truncated when there is no more space left.
Here the link to my jsfiddle.