display: flex; //Parent element
and
flex-wrap: wrap; //Direct child elements
Each grid has to fill 25% of the containers width and go down automatically..
But currently they do not act like flex-wrap: wrap; they act like they are 20% width when there are 5 grids... its a bit weird because they are set to be 25% ?
If I put Flex-wrap: wrap;
on the parent element where I currently have display:flex;
it works, but then they are not equal heights?
What do I do in this situation? I can't figure out how to do this
Find the example here: http://www.chri126g.wigf1.sde.dk/DUER1/
HTML
<div class="global-wrapper">
<div class="dueWrapper flex">
<div class="dueOuter col25 flex-w-w">
<div class="dueInner flex-d-r">
<img src="img/salg/1.jpg" alt="due">
<table>
<tr>
<td>Navn</td>
<td>Smith</td>
</tr>
<tr>
<td>Far</td>
<td>Jackson</td>
</tr>
<tr>
<td>Mor</td>
<td>Emelie</td>
</tr>
<tr>
<td>Pris</td>
<td>500kr</td>
</tr>
</table>
</div>
</div>
<div class="dueOuter col25 flex-w-w">
<div class="dueInner flex-d-r">
<img src="img/salg/2.jpg" alt="due">
</div>
</div>
<div class="dueOuter col25 flex-w-w">
<div class="dueInner flex-d-r">
<img src="img/salg/3.jpg" alt="due">
</div>
</div>
<div class="dueOuter col25 flex-w-w">
<div class="dueInner flex-d-r">
<img src="img/salg/3.jpg" alt="due">
</div>
</div>
<div class="dueOuter col25 flex-w-w">
<div class="dueInner flex-d-r">
<img src="img/salg/3.jpg" alt="due">
</div>
</div>
</div><!--/DUE-WRAPPER-->
</div><!--/GLOBAL-WRAPPER-->
CSS
.flex {
display: flex;
}
.flex1{
flex: 1;
}
.flex-d-r{
display: flex;
flex-direction: column;
}
.flex-w-w{
display: flex;
flex-wrap: wrap;
}
body{
background-color: lightgrey;
}
.global-wrapper{
padding: 5px;
width: 90%;
min-height: 100vh;
max-width: 1000px;
margin: 0 auto;
background-color: #fff;
}
.dueOuter{
padding: 5px;
}
.dueInner{
outline: 1px solid #000;
min-height: 100px;
transition: 0.3s ease;
-webkit-box-shadow: 0px 0px 9px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 9px 0px rgba(0,0,0,0.75);
-webkit-box-shadow: 0px 0px 9px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 9px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 9px 0px rgba(0,0,0,0.75);
}
.dueInner:hover{
b: 3px solid #000;
}
.dueInner img{
width: 100%;
}
td{
width: 100%;
}
tr:nth-of-type(odd){
background-color: lightgrey;
}