The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

how to make sure div spans whole height?

hey guys i was wondering how to make a div span the whole height of the page (even if the page is longer, causing scrollbars)?

i put height:100% in my stylesheet but it doesnt seem to do it.. it just spans the height of the browser, and when the page is longer it stops at the height of the browser and not span all the way down..

heeh great script jofa you have come to the rescue again man! but i have one more small request..is it possible to have the left div already fill the height of the screen? and when and only when the right div has enough text and will have to use scrollbars the left div expands with the right div?

*edit to make it clearer, i would like that height:100%; if it could be incorporated somehow..since i always want my left div spanning the height of the browser..

dang jofa you might be mad at me but i also have one more request... it seems that i have my right div start 20px from the top of the browser... so it seems that the left div doesnt compensate for the 20px and there is a 20 px space from the bottom of the left div to the bottom of the browser (when theres more info in right div then the height of the browser) can you compensate for this?

Also, if the right div doesn't have a fixed width you might want to call the setHeight function onresize also. This is because if the user resizes the window, the content of the right div will be refloated and it's height will increase. Calling the setHeight onresize, will make sure that the left div is always as long as the right one.

heh thats nice s7even and jofa, but weird thing is if i make my browser window smaller and load up the page... then resize the browser window higher...the left div doesnt seem to update with the browser..what might be wrong or is there nothing you can do about it