40
#Container {
    width: 500px;
    height: 600px;
}

#TheElement {
    width: 500px;
    height: 100px;
    background-color: #000000;
}

How do i get #TheElement to be locked to the very bottom of #Container, regardless of the other content inside container, without a bunch of margin trickery?

pnuts
  • 56,678
  • 9
  • 81
  • 133
WillingLearner
  • 6,796
  • 6
  • 33
  • 51

1 Answers1

82

You can use relative absolute positioning:

http://jsfiddle.net/gzJM6/

#Container {
    width: 500px;
    height: 600px;
    position: relative
}

#TheElement {
    width: 500px;
    height: 100px;
    background-color: #000000;
    position: absolute;
    bottom: 0;
    left: 0;
}
thirtydot
  • 217,782
  • 47
  • 385
  • 346