I have a display flex container with column flex direction. It has bunch of children with different content and each having auto width to fit their contents. I want only specific elements' content to be wrapped so it has the same width as other elements. Here is what I tried so far:
body {
display: flex;
justify-content: center;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container,
.container > div {
border: 1px solid grey;
padding: 5px;
}
.container {
display: flex;
flex-direction: column;
flex-wrap: wrap;
gap: 5px;
}
.child {
flex-grow: 1;
max-width: 100%;
}
.wrapped-child {
white-space: normal; /* This line isn't doing anything */
}
<div class="container">
<div class="child">Some content</div>
<div class="child">
<div>
Some fancy content
</div>
<div>Some more</div>
</div>
<div class="wrapped-child">
<p>
Here comes bunch of content that takes the most width but has to be
multiline
</p>
</div>
</div>
How can I achieve this behavio in flexbox (of course without using any javascript)?