homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

Problem with height: 100% rule for DIV
A DIV positioned absolute in the body

10+ Year Member

Msg#: 4176 posted 9:28 pm on Jul 22, 2004 (gmt 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?



10+ Year Member

Msg#: 4176 posted 7:08 am on Jul 23, 2004 (gmt 0)

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

I've got the same problem here.


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

Msg#: 4176 posted 10:49 am on Jul 27, 2004 (gmt 0)

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



10+ Year Member

Msg#: 4176 posted 12:05 pm on Jul 28, 2004 (gmt 0)

yeah better make it like this:

html,body {
height: 100%;

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved