how to align two
.container{
border: 2px solid black;
display: flex;
flex-wrap: wrap;
}
.container-part{
width: 50%;
}
<div class="container">
<div class="container-part">
1
</div>
<div class="container-par">
2
</div>
</div>
divs under each other with property display flex on reducing size.
2
Answers
you need
min-width
property to the container-part so that when it overflows it wraps the divs.https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap
what
flex-wrap:wrap
does is it wraps the div to come on another row when the total width of the divs exceed the width of the viewport.provided you missed the typo in this
Try this: