This task looks easy but I didn't find it so when trying to resolve it.
I have two flex items in column, first is 77% width with 5% right margin (to keep space between first and second item), the second is 18% width. When there 21% is not enough for second div content, it goes down to the second line, and fully fills it (flex-grow is set to 1). The first element also has grow of 1 and fills first line, but the right margin still remains.What I want - two lines fully filled with every of two items.
How to achieve this?
.container {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
width: 50vw;
}
.one, .two {
background: green;
color: white;
flex-grow: 1;
margin-bottom: 1rem;
}
.one {
flex-basis: 77%;
margin-right: 5%;
}
.two {
flex-basis: 18%;
}
<div class="container">
<div class="one">I am one I am one I am one I am one</div>
<div class="two">I am two I am two</div>
</div>
(huh, scaling gives no effect here, see it at https://jsfiddle.net/1471djg7/3/ )