Welcome to WebmasterWorld Guest from

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)

New User

10+ Year Member

joined:July 22, 2004
votes: 0

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 July 23, 2004 (gmt 0)

New User

10+ Year Member

joined:July 22, 2004
votes: 0

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

I've got the same problem here.

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

Senior Member

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

joined:Oct 1, 2002
votes: 0

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


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

Junior Member

10+ Year Member

joined:Feb 15, 2004
votes: 0

yeah better make it like this:

html,body {
height: 100%;


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members