View Full Version : 100% height inside another div?

07-26-2009, 08:11 PM
Hi there,

Just a quick question. im trying to make a navigation bar on the left, which the height corresponds to the height of the of the div it is inside.

I made the height of the navigation bar 100%, but it made it as though it was 'auto', so it will be the height of the content inside.

I read that the div it is in must have a defined height. that is set on 100%, but it is still not working..

any ideas?

thanks a lot


07-26-2009, 10:14 PM
Do you just want a background behind the whloe nav column or do you want the links to spread out and fill up the column?

07-26-2009, 10:29 PM
cheers for the reply

the links are spread at the top, but the main content changes height over the different pages, so i need that to be on auto.

here is the link (i think you saw it in the other thread)


i would like the red bar on the left to be 100% height inside the white div it is in, with the main content in.

it just seems to be thinking its auto.

does that make sense??



07-27-2009, 06:03 AM
Whichever will be your longest column (I guess content) then give that a white background. Then give your wrapper the red background you have on your side bar. That way, even if your sidebar doesn't reach the bottom, it will appear to be red all the way down.

07-27-2009, 10:56 AM

but one thing. if i did that, would the whole wrapper not be white? and that spans from the top to the bottom of the page.

The way i have it now is the sidebar(red) is inside the main content div(the MC div is the width of the wrapper div. before i had it as there being a sidebar div, then a MC div floated to the right of the side bar, I just need the side bar to resize in the same size the MC is. I assumed you can 100% it inside the MC div, but it doesnt seem to work.

sorry corrosive if i didnt understand your post. it porbably does make sense.

it shouldnt be too hard to do, as a lot of sites have it...

do you think it would be ok to have a vertically tiled background inside the MC with the red bar on the side? and just have new divs for the links...

this site is taking a lot of thinking. haha. when i took it on, i thought they wanted a simple one or 2 page site. obviously not. and im not even getting paid.... ahh well. its teaching me a lot.

cheers for everyones help so far. appreciate it