I have a flex container with flex-direction: column
and two child elements. The contents of both children are dynamic, so their sizes / widths can vary. Now I want to sepcify that only the second element can determine the max width. So only the second elment can "grow" in width. The first element should only grow to the width of the second child. How can I accomplish this?
Below is an example of the situation. In the example the width is determined by the first element since it has more content inside. But how can I say that the width is determined by the second element and the first just "fits" to the width?
<div class="container">
<div class="first">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
</div>
<div class="second">
<ul>
<li>First item (with some information)</li>
<li>Second item (with some information)</li>
<li>Third item</li>
</ul>
</div>
</div>
.container {
display: flex;
flex-direction: column;
}