Please consider the following example:
https://jsfiddle.net/mr4fapx7/1/
<div class="z">
<div class="z1">1</div>
<div class="z1">2</div>
<div class="z1">3</div>
</div>
.z {
display: flex;
align-items: flex-start;
/* flex-direction: column; */
flex-wrap: wrap;
height: 1000px;
background: #900;
}
.z1 {
min-width: 51%;
background: #0f0;
}
I can't understand this behavior of flex... why does z1
els aren't aligned one after another as if you apply flex-direction: column
to it? What is the logic behind it and is there a good way of making it "automatically" switch as if it where flex-direction: column
as in this example?
UPDATE:
seems like I didn't explain myself correctly. Please try the above example with uncommented flex-direction
property and see the desired behavior