I am trying to use flexbox to align two divs within their parent with one completely centered and the other bottom-center. They both share the same parent div. The result should be like this:
------------------------
| |
| |
| |
| |
| ------ |
| | b1 | |
| | | |
| ------ |
| |
| ------ |
| | b2 | |
| ------ |
------------------------
This is what I have so far:
div {
box-sizing: border-box;
border: 1px black solid;
}
.text-center{
text-align:center;
}
.flex-wrap {
width:400px;
height: 400px;
background: #ddd;
display: flex;
align-items: flex-start;
}
.flex-centered {
align-self: center;
}
.flex-bottom-center {
align-self: flex-end;
}
<div class="flex-wrap">
<div class="flex-centered text-center">
Here is some text for the center
</div>
<div class="flex-bottom-center text-center">
Here is some text for the bottom center
</div>
</div>
It seems almost there but the first box is left aligned whilst the bottom is right aligned.
Can anyone help?
Edit: this is not the same as the question cited in marking mine as duplicate: that question is asking how to make the bottom div
equidistant to the center div
and the bottom. Mine is asking how to place the bottom div
at the bottom of the container.