fluid-height div between two fixed-height fixed-position divs
I have a header and footer that are specific (pixel) heights and position:fixed.
I have a content box between them that needs to resize based on the window height... On my monitor "74%" is perfect, but on my second monitor it's more like "85%"... My header is 110px tall and my footer is 60px tall... How do I make the content stay between them?
I currently have the content as position:absolute and with margins on the top and bottom of the right sizes, but it doesn't really work because the "height: 74%;" doesn't change based on the screen size and the header and footer sizes don't change at all...
Any help on this would be greatly appreciated.
Fixed and absolute positioning, hummm!
Did you choose the fixed positioning because you don't want the header and footer to move when the page is scrolled or do you have other reasons?
Yes, that's exactly why. The header and footer are transparent (backgrounds) and there is a background image for the whole page... so content showing up behind the header (logo & Navigation) or footer (copyright info) looks horrible.
Unless you don't want the content area's height to stretch as needed, you will have the same issue as the content grows.
Because of the difference in screen sizes the percentage in the height will not work the same for all users.
padding:110px 0 60px;
<div id="header"> </div>
<div id="content">content area
<div id="footer"> </div>
Last edited by holyhttp; 05-31-2012 at 03:32 PM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)