How do I align my items to always place it on top. I am using flex to my container.
Note: The number of items are dynamically generated.
<div class="container">
<div class="item">ITEM 1</div>
<div class="item second">ITEM 2</div>
<div class="item">ITEM 3</div>
</div>
.container {
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
.item {
width: 45%;
height: 100px;
background-color: lightgray;
margin: 0 20px 20px 0;
display: flex;
justify-content: center;
align-items: center;
}
.second {
height: 150px;
}
Here is my plunkr