I have a footer I am trying to create that provides valuable information in the bottom-right area (i.e. which db I am connected to, the current project version, and backend code version) to streamline troubleshooting. I have the layout almost structured like I want, but the only thing left I want to do is make the key, value pairs align vertically for every row while positioned at the end of the page. In other words, I want the key (or left column) to be right-aligned, and the value (or right-column) to be left-aligned. Is this possible?
Here is the desired behavior:
|
|
"TCIS": alsdkfgjioae;asfaseighnaasig|[end of page]
"mongoDB": master |
|
The footer:
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<footer class="footer container-fluid mt-auto">
<div class="row align-items-end text-muted mb-1">
<div class="col"></div>
<div class="col-auto text-center"> Powered by [Some img] </div>
<div class="col text-end">
<div> TCIS <div class="text-dark fw-bold" style="display: inline-block;"> v1.0b1.dev65+git170ae7d </div>
</div>
<div> mongoDB <div class="text-dark fw-bold" style="display: inline-block;"> master </div>
</div>
</div>
</div>
</footer>
(Full working project here)
Thank you
2
Answers
Since your website already uses bootstrap, one way (without adding more CSS) is to use rows and cols like so:
The
text-start
class aligns text to the left,text-end
class aligns text right, andfw-bold
sets the font weight to bold.Demo:
You could use the
<span>
element instead of<div>
.