How can I position my div at the bottom of its container?

Dónal picture Dónal · Feb 8, 2009 · Viewed 1.2M times · Source

Given the following HTML:

I would like #copyright to stick to the bottom of #container. Can I achieve this without using absolute positioning?

Answer

User picture User · Feb 8, 2009

Likely not.

Assign position:relative to #container, and then position:absolute; bottom:0; to #copyright.


#container {
    position: relative;
}
#copyright {
    position: absolute;
    bottom: 0;
}
<div id="container">
  <!-- Other elements here -->
  <div id="copyright">
    Copyright Foo web designs
  </div>
</div>