I'm trying to achieve design like shown below using CSS. Unfortunately all my efforts are worthless. Whatever I try it always seems to work for only one line (only 2 divs) instead of two lines. I'm using wrap attribute. What am I doing wrong?
edit: in this case I can't use nested flexboxes
Desired look:
<div style="width:400px;height:100%;background:#cacaca;
display: -moz-flex;
display: -webkit-flex;
display: -ms-flex;
display: flex;-moz-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
">
<div style="width:200px;height:200px;background:#ff0000"></div>
<div style="width:100px;height:100px;background:#999;"></div>
<div style="width:100px;height:100px;background:#666;"></div>
<div style="width:100px;height:100px;background:#444;"></div>
<div style="width:100px;height:100px;background:#222;"></div>
</div>