Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make div scale vertically all the way down?

Tags:

html

css

I have the following situation, presented in the picture. Grey div is the parent of magenta and blue divs. Magenta div scales vertically with the content. I would like to have blue div always scale to the bottom of the containing grey, div. I've searched and tried various combinations, but all to nil effect.

alt text

edit: Problem solved! Container needs an overflow: hidden, and the div that I want to stretch to the bottom (blue) needs padding-bottom: 1000px; margin-bottom: -1000; (or larger if you need)

like image 261
Keyframe Avatar asked Jun 30 '09 19:06

Keyframe


1 Answers

I got this to work (in Chrome anyway) by setting the parent's div:

position: absolute;

and the child's div:

height: 100%;
like image 77
jLi Avatar answered Oct 13 '22 12:10

jLi