-2

I'm currently working on a webpage where i have a template and add the content in after so i have a div which changes height depending on the content put in it. i want to put another div down the side which will stretch down to the bottom of the first div no matter what size the original div is.

i have tried doing it by using:

    height:100%

and a few other methods in CSS

Thanks

Martin42006
  • 63
  • 1
  • 8

1 Answers1

2

If its a case of a div inside a div and you want the second div to be at the bottom of the first div then.

set for div1:

position:absolute;

and for div 2:

position: absolute;
bottom: 0;
bbeckford
  • 4,467
  • 6
  • 34
  • 48
Robin Rizvi
  • 5,113
  • 4
  • 27
  • 35
  • @Martin42006 This doesn't set the top of the 2nd div at the bottom of the 1st div. Still it is accepted. Did the top of the 2nd div stretch to the bottom of the 1st. Check this fiddle(**http://jsfiddle.net/x8YE6/**) with this implementation. – Rajesh Paul Dec 31 '13 at 15:31
  • @RajeshPaul no but this sets the bottom of the second div to the bottom of the first div and then i can adjust the heights accordingly – Martin42006 Dec 31 '13 at 16:44