Вот код HTML:
<div id="header">
</div>
<div id="container">
<div id="leftbar">
</div>
<div id="content">
</div>
</div>
<div id="footer">
</div>
И вот чего я хочу достичь, даже если это не правильный CSS, но я думаю, вы поймете мою мысль:
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 */
}
#leftbar /*fixed width, the height is always the same as the screen height*/
{
height:100%;
width:200px;
}
#content
{
height:100%;
width:100%-200px; /* take all the screen width left except the leftbar */
overflow:auto;
}
Кто-то просто привел это в качестве примера:
http://limpid.nl/lab/css/fixed/header-and-footer
Я не думаю, что использование <body>padding
для исключения верхнего и нижнего колонтитулов является хорошим способом, потому что я хотел бы, чтобы все полосы прокрутки отображались внутри содержимого div #, а не для всего тега <body>
.