Here is an example of my code :
.flex-container {
height: 300px;
width: 300px;
display: flex;
align-items: center;
justify-content: center;
background-color: #ffeeee
}
#item1 {
width: 100px;
height: 100px;
background-color: blue;
}
#item2 {
width: 120px;
height: 120px;
background-color: red;
}
<div class="flex-container">
<div id="item1"></div>
<div id="item2"></div>
</div>
https://jsfiddle.net/vL508wax/
I want the blue square to be centered and the top of the red square to be flush with the top of the blue square.
I know I can do this with margin-top for example but I don't think that's a good way to go. Can I do this with flexbox directly ?