471,895 Members | 2,330 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,895 software developers and data experts.

100% height div w/ background!

Since I began doing CSS layouts instead of tables last year, it seems like every single site I do I run into the same problem -- getting a div to stretch to 100% height. I find the solution to it, it works; then when I try the exact same solution for the next site I do, it refuses to work properly. It's very frustrating how such a simple concept can be so hard to do...


There are two divs -- left column and right column -- within a page_wrapper div. I need the right column div and it's background to always be 100% height and touch the top and bottom of the window. But right now it only stretches to the window viewable area and doesn't continue when you scroll.

I've included all the parent height commands. I've been fighting with this dang thing for a whole day and I'm not sure what else to try. Please help!
Nov 4 '08 #1
1 1633
7,435 Expert 4TB
I'm not on my dev computer so I can't check but when you use absolute positioning, that element is removed from the normal flow, as does floating. This could be the cause of the bottom rising up to replace those elements. I don't know why you need to use abs pos there.
Nov 4 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.