I have created elements that looks like shown below..
I made the preview above with flexbox like so:
CSS
.wrapper {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.wrapper * {
width: 350px;
margin: 5px;
}
.elem1 {
background-color: pink;
height: 100px;
}
.elem2 {
background-color: teal;
height: 60px;
}
.elem3 {
background-color: yellow;
height: 80px;
}
.elem4 {
background-color: orange;
height: 120px;
}
HTML
<div class="wrapper">
<div class="elem1">
elem1
</div>
<div class="elem2">
elem2
</div>
<div class="elem4">
elem4
</div>
<div class="elem3">
elem3
</div>
</div>
is there any way to make the elem3
element to float vertically so that it would stick to the bottom of elem2
?
please note that I can't use col-md-xx
because then when in responsive mode those elements' flow will become elem1 -> elem4 -> elem2 -> elem3
instead of elem1 -> elem2 -> elem3 ->elem4
..
and also, in my real project the height of the elements are not fixed but depends on the content..
any ideas?