I am working with a Bootstrap 5 row that contains multiple columns. Each column consists of an image and a paragraph.
Since the images have varying heights, I am trying to align everything by:
- setting the child div to have a height of 100% using
h-100
- aligning the image to the top using
align-top
- aligning the paragraph to the bottom using
align-bottom
<div class="row">
<div class="mt-5 col text-center">
<div class="h-100 border">
<div class="align-top">
<img class="img-fluid" src="example1.png" width="180">
</div>
<div class="align-bottom">
<p>Paragraph 1</p>
</div>
</div>
</div>
<div class="mt-5 col text-center">
<div class="h-100 border">
<div class="align-top">
<img class="img-fluid" src="example2.png" width="180">
</div>
<div class="align-bottom">
<p>Paragraph 2</p>
</div>
</div>
</div>
</div>
However, it seems like align-bottom
is not having any effect. It's possible that align-top
isn't either, but I haven't confirmed as the default alignment is at the top.
What could I be doing incorrectly?