The container actually is 100% wide, i.e. spans the full width of the window. But with the default flex settings, its children will simply align left and will be only as wide as their contents.
However, if you apply flex-grow: 1;
to the child elements to allow them to get wider, they will stretch and fill the full width of the container.
.masonry_container {
display: flex;
}
.masonry_left_col {
border: 1px solid grey;
flex-grow: 1;
}
.masonry_right_col {
border: 1px solid grey;
flex-grow: 1;
}
<div class="masonry_container">
<div class="masonry_left_col">
Content
</div>
<div class="masonry_right_col">
Content
</div>
</div>
Or, if you just want the flex items to go full left and right inside the container without stretching, add justify-content: space-between
to the container
.masonry_container {
display: flex;
justify-content: space-between;
}
.masonry_left_col {
border: 1px solid grey;
}
.masonry_right_col {
border: 1px solid grey;
}
<div class="masonry_container">
<div class="masonry_left_col">
Content
</div>
<div class="masonry_right_col">
Content
</div>
</div>