I have two div
elements, which adjust their sizes dependent on the content in those elements. The problem is that if they both filled with content and I set even more content in the left element, it grows and makes the right element smaller, even though the right one already full with a content:
.container {
border: 2px solid black;
width: 400px;
height: 50px;
display: flex;
flex-flow: row;
}
.side {
height: 100%;
flex-grow: 1;
background-color: grey;
}
.left {
max-width: 60%;
min-width: 45%;
padding-right: 5%;
}
.right {
max-width: 45%;
min-width: 30%;
padding-left: 5%;
}
.content {
width: 100%;
height: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.one {
background-color: yellow;
}
.two {
background-color: blue;
}
<div class="container">
<div class="left side">
<div class="content one">
Very long content that right now pushing div on the right side even though the right side already full!
</div>
</div>
<div class="right side">
<div class="content two">
Barely overfill the right side.
</div>
</div>
</div>
So how can I let my right element take all necessary space when it's needed and prevent left element pushing just because it has more content?
Hope that I can get some help with my problem!