Hey I am trying to create a responsive box layout for a gallery, which looks like this http://webdesignerwall.com/demo/responsive-column-grid/
The problem with the example is that the widths are hardcoded and media queries are necessary. I have way to many columns for that to be a feasible solution.
I can achieve the same result with Flex girds, however the last column is larger than the others as shown in this CodePen:
http://codepen.io/anon/pen/zClcx
HTML
<div class="flex-container same-width same-height">
<div class="flex-item">
<div>g</div>
</div>
<div class="flex-item">
<div>g</div>
</div>
<div class="flex-item">
<div>g</div>
</div>
<div class="flex-item">
<div>why am I longer than my friends?</div>
</div>
</div>
CSS
.flex-container {
display: -webkit-flex;
display: flex;
width: 100%;
max-width: 950px;
flex-wrap: wrap;
justify-content: space-between;
background: grey;
& > * {
min-width: 300px;
background: green;
max-width: 404px;
flex: 1 1 auto;
}
.flex-item > div {
background: red;
}
}
Question: How can I make the last column the same size as the others?