Answer the question
In order to leave comments, you need to log in
Why do nested flex items not respect the size of their parent container?
Greetings.
There is a simple example: https://codepen.io/weranda/pen/QWNBLge
<div class="wrap">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
</div>
.wrap{
display: flex;
flex-basis: 60%;
}
.item{
flex-basis: 33.333%;
}
Answer the question
In order to leave comments, you need to log in
use width for .wrap, there is a feeling that flex-basis works on elements inside a flex container, and your wrap is not wrapped by any container with display: flex;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question