Html – align div in the bottom of another div using css

csshtml

I want to align the DIV c in the bottom of the DIV b not DIV a

<div id="a">
   <div id="b">
        <div id="c">
              Div c
        </div>
   </div>
</div>

Best Answer

This should work:

#b {
  position: relative;
}

#c {
  position: absolute;
  bottom: 0px;
}

The trick is position: relative; on the parent element. Without that, #c will float away to the bottom of the page.