I have a grid which in this examples has 4 coloumns (width:25%). This is fine however I need the columns to be equal height. The content will be loaded in dynamically so I can't set a fixed height.
I have implemented flexbox and while this solves the height problem, it seems to ignore the percentage widths.
Below is my code and here is a link to the codepen... http://codepen.io/anon/pen/CEHgo
HTML
<div class="row">
<div class="col3">
<div class="box">Lorem ipsum</div>
</div>
<div class="col3">
<div class="box">Lorem ipsum</div>
</div>
<div class="col3">
<div class="box">Lorem ipsum</div>
</div>
</div>
CSS
* {box-sizing:border-box}
.row {
margin-left: -1%;
margin-right: -1%;
margin-bottom: 1em;
display:flex;
}
.row:before,.row:after {
content: " ";
display: table;
}
.row:after {
clear: both;
}
.col3 {
position: relative;
float: left;
padding-left: 1%;
padding-right: 1%;
width:25%;
display:flex;
}
.box {
background:#ccc;
padding:15px;
margin-bottom:15px;
}
How can I get equal height coloumns whilst still respecting the column widths?
Thanks in advance