I am trying to figure out how to have two divs side by side with equal width. However, if the text in the first div wraps onto a second line, I want the second div to move below the first one and both divs should double in width. Can CSS handle this type of layout?
I attempted using flexboxes but I am not sure what the next steps are.
#container {
display: flex;
width: 500px;
border: 1px solid black;
}
.cell {
flex: 1;
}
<div id="container">
<div class="cell" style="background-color:pink;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit
</div>
<div class="cell" style="background-color:lightblue;">
Ut enim ad minim veniam, quis nostrud exercitation ullamco
</div>
</div>