12

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,701
  • 2
  • 12
  • 21
Adham
  • 63,550
  • 98
  • 229
  • 344

3 Answers3

46

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
  • 289,723
  • 53
  • 439
  • 496
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
  • 28,547
  • 16
  • 75
  • 90
Max Spencer
  • 1,701
  • 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/