tags:

views:

242

answers:

2

Here is the HTML code:

<div id="header">
</div>
<div id="container">
</div>
<div id="footer">
</div>

And here is what I want to achieved, even though it's not valid CSS, but I think you will understand my point:

html,body
{
 min-width:800px;
 max-width:1680px;
 width:100%;
 height:100%
}
#header
{
  width:100%;
  height:100px;
  background:#CCCCCC url(images/header_bg.gif) repeat-x; 
}
#footer
{
  width:100%;
  height:10px;
}
#container
{
 width:100%;
 height:100%-100px-10px;   /* I want #container to take all the screen height left */
}

is it possible to only use CSS for achieving some layout like this: the whole body will fit the screen size always, however the #header and #footer areas are with fixed height, and then the main div takes all the height left. Thanks!!

+3  A: 

Something like this? http://limpid.nl/lab/css/fixed/header-and-footer or you don't want the main content to scroll?

Jimmie Lin
this is kind of what I'm looking for, however I don't want to the scroll bar appear for the whole page(even though the header and footer are fixed). Is it possible to only show the scrollbar inside the div#content (in your example), because I will have more divs inside div#content, I don't want lots of scrollbars at the right side.
WilliamLou
A: 

something like this: http://ryanfait.com/sticky-footer/ might also be what you are looking for

akearney
what is this trying to demonstrate? just looks like a footer to me...
Jason