There is a couple of fixed size inline blocks (material icons) that should be vertically positioned within a fluid block - one is in the middle, another is at the bottom.
Here's an example that explains this:
body {
width: 100%;
}
.square-container {
position: relative;
padding-top: 100%;
background: #999;
}
.square {
position: absolute;
left: 0;
top: 0;
width: 20%;
height: 20%;
background: #ddd;
align-items: center;
display: flex;
flex-direction: column;
justify-content: space-between;
}
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" type="text/css" rel="stylesheet">
<div class="square-container">
<div class="square">
<i class="material-icons"> </i>
<i class="material-icons icon-1">local_see</i>
<i class="material-icons icon-2">grade</i>
</div>
</div>
I'd like to address some issues here.
One is that it involves extra <i class="material-icons"> </i>
placeholder to make both icons stay in places.
Another one is that icons cannot use space efficiently when a container is small enough (a demo). It is desirable that two icons would make use of space occupied by the placeholder instead of overflowing.
How can this be done?
This is primarily flexbox question, but if the same layout can be reached without flexbox with same degree of flexibility, this would be good too.