Welcome to WebmasterWorld Guest from 54.197.116.116

Forum Moderators: not2easy

Message Too Old, No Replies

Problem with height: 100% rule for DIV

A DIV positioned absolute in the body

   
9:28 pm on Jul 22, 2004 (gmt 0)

10+ Year Member



My xhtml page has all of the body code INSIDE a absolutely positioned DIV, with a height of 100% and a width of 800px. The div background is white, while the page background is blue.
Inside of this "body" div are two relatively-positioned divs: one with main content/navigation, and one with a footer.
I wanted the "body" div to stretch to the bottom of the screen (100%) and leave a blue column on the right (after the 800pixel div ends). The main content/navigation div should push the footer to the end of the page.
Instead, the browser ignores the div background color, and I get blue background everywhere, unless I set the "body" DIV height to a value like 400px.

Why doesn't height: 100% make the DIV go all the way down?

7:08 am on Jul 23, 2004 (gmt 0)

10+ Year Member



Because 100% of the content is using not of page/screen.

I've got the same problem here.

10:49 am on Jul 27, 2004 (gmt 0)

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member



have you got 100% height set on both the <html> and <body> elements too?

Suzy

12:05 pm on Jul 28, 2004 (gmt 0)

10+ Year Member



yeah better make it like this:

html,body {
height: 100%;
}