...">

Align a div at the bottom of another div using css

I want to align DIV cat the bottom of DIV bnotDIV a

<div id="a">
   <div id="b">
        <div id="c">
              Div c
        </div>
   </div>
</div>
+5
source share
3 answers

This should work:

#b {
  position: relative;
}

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

The trick position: relative;in the parent element. Without this, it #cwill move to the bottom of the page.

+34
source

It will exit the document stream div#c. This may not be perfect, but you can do something like the following:

#b {
  position: relative;
}

#c {
  position: absolute;
  bottom: 0;
}
+8
source

Click this link, maybe it will 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/

0
source

All Articles