11

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>
Max Spencer
  • 1,661
  • 2
  • 12
  • 21
Adham
  • 61,516
  • 96
  • 221
  • 343

3 Answers3

45

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.

Blender
  • 275,078
  • 51
  • 420
  • 480
8

It will take div#c out of the flow of the document. It may not be perfect, but you can do something like the following:

#b {
  position: relative;
}

#c {
  position: absolute;
  bottom: 0;
}
apaderno
  • 26,733
  • 16
  • 74
  • 87
Max Spencer
  • 1,661
  • 2
  • 12
  • 21
1

Click in this link, maybe it can help you

#b {
display: -webkit-inline-flex;
display: -moz-inline-flex;
display: inline-flex;

-webkit-flex-flow: row nowrap;
-moz-flex-flow: row nowrap;
flex-flow: row nowrap;

-webkit-align-items: flex-end;
-moz-align-items: flex-end;
align-items: flex-end;}

http://jsfiddle.net/rudiedirkx/7FGKN/