I am trying to position a div at the bottom of the containing div.
https://prnt.sc/q2iasz
I tried having position: relative
for the parent div and position: absolute, bottom: 0
but the code seems not to be working. If I give a fixed-bottom
class, the div goes all the way bottom.
Here’s my code.
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<section class="fluid-container hero position-relative">
<div class="absolute-wrapper h-100">
<div class="row bg-white fixed-bottom">
<div class="container w-50">
<h1 class="content text-dark">left</h1>
</div>
<div class="container w-50">
<h1 class="content text-dark">right</h1>
</div>
</div>
</div>
</section>
Here’s the screenshot. https://prnt.sc/q2ierd
Am I doing something wrong with the positioning?
2
Answers
fixed-bottom
gives the elementposition:fixed
which will make it relative to the viewportuse
.position-absolute
insteadlooks like you will need a custom class aside
position-absolute
: