The following code produces a set of blue boxes and within two of these boxes a small white box is displayed. How can I make these white boxes stick to the bottom of the blue boxes? I tried to add margin-top: auto;
to .test
but that did not work.
.flex-container {
display: -webkit-flex;
display: flex;
width: 400px;
height: 250px;
background-color: lightgrey;
flex-wrap: wrap;
}
.flex-item {
background-color: cornflowerblue;
width: 100px;
height: 100px;
margin: 10px;
}
.test {
background-color: white;
width: 20px;
height: 20px;
margin-bottom: 0 auto;
}
<div class="flex-container">
<div class="flex-item">flex item 1flex item 1flex item 1flex item 1flex
item 1<div class="test"></div></div>
<div class="flex-item">flex item 2<div class="test"></div></div>
<div class="flex-item">flex item 3</div>
<div class="flex-item">flex item 3</div>
<div class="flex-item">flex item 3</div>
</div>