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
  • 58,317
  • 11
  • 87
  • 139
WillingLearner
  • 7,106
  • 6
  • 34
  • 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
  • 224,678
  • 48
  • 389
  • 349