I am building a grid layout with Bootstrap 4. I am trying to vertically align content inside a column while keeping the full height of the column.
Currently my layout looks like this:
However, I want the content of the columns aligned like this:
Current CSS:
html, body {
height: 100%;
}
.flex-fill {
flex: 1;
}
Current HTML:
<div class="container d-flex h-100 flex-column">
<div class="row flex-fill d-flex">
<div class="col-8 bg-dark m-2">
TEXT
</div>
<div class="col bg-dark m-2">
TEXT
</div>
</div>
<div class="row flex-fill d-flex">
<div class="col bg-dark m-2">
TEXT
</div>
</div>
</div>
Please also see JSFiddle.
I already tried to use the .align-self-center class and was able to align the content in the middle of the row. However, I could not keep the full-height of the column.
Any ideas on how to achieve the target layout?
Thank you very much for your support!