I expected the blue and red box to wrap when the screen width is small in this example, because the cyan box is set to flex-wrap.
However, that's not happening. Why is this not working?
Here is the code:
.foo,
.foo1,
.foo3 {
color: #333;
text-align: center;
padding: 1em;
background: #ffea61;
box-shadow: 0 0 0.5em #999;
display: flex;
}
.foo1 {
background: green;
width: 200px;
flex: 1 1 100%;
}
.foo2 {
background: pink;
display: flex;
padding: 10px;
}
.foo3 {
background: cyan;
flex-wrap: wrap;
}
.bar1,
.bar2 {
background: blue;
width: 50px;
height: 30px;
}
.bar2 {
background: red;
}
.column {
display: flex;
flex-direction: column;
flex-wrap: wrap;
background: orange;
height: 150px;
}
<div class="column">
<div class="foo1"></div>
<div class="foo">
<div class="foo2">
<div class="foo3">
<div class="bar1"></div>
<div class="bar2"></div>
</div>
</div>
</div>
<div class="foo1"></div>
</div>
Please see the details in the following link: http://codepen.io/anon/pen/vxExjL