I have a container that contains a row with 2 columns.
I would like to VERTICALLY center the container in the middle of the page. Please advise how you would solve this. I do not want to use the TOP CSS command style. I tried multiple ways with no success.
Make sure that the HTML and Body elements stretch the full page, give the container a height and display a border for the visual effect. This is only for the example.
Then give the row a height of 100%, the main column a top and bottom margin of auto and all should be well.
<div class="container mt-5">
<div class="row h-100">
<div class="col-sm-12 mt-auto mb-auto">
<div class="row">
<div class="col text-center">
I am Left
</div>
<div class="col text-center">
I am Right
</div>
</div>
</div>
</div>
It’s technically impossible to make this available for “any” element. That’s how HTML and CSS work. A screenshot or two of your app structure can help us answering your question.