pcarrollnf
04-26-2011, 03:18 PM
I have 3 DIVs in my HTML page. I have a header, content area and a footer. The CSS for the header is the following:
#header
{
position:absolute;
top:0;
left:0;
width:100%;
height:120px;
overflow:auto;
background:#FFFFFF;
}
The CSS for the container div is:
#container
{
position:fixed;
top:121px;
left:0;
bottom:30px;
right:0;
overflow:auto;
background:#FFFFFF;
padding:0px;
text-align:center;
}
And the CSS for the footer is:
#footer
{
position:absolute;
bottom:0;
left:0;
width:100%;
height:30px;
overflow:auto;
text-align:right;
}
When I resize the browser window to make it smaller, eventually horizontal scrollbars appear in the header DIV (the container and footer DIVs will eventually contain horizontal scrollbars if I continue to make the window smaller). The header DIV will also contains very small vertical scrollbars which are barely usable. When the horizontal scrollbars appear in the header, how can I adjust the DIVs so that the header div does not need the vertical scrollbar? It seems that if the header div is given more height and container div is shifted down,there would be no need for the vertical scrollbar. Is there a way of having the browser do this automatically or do I have to detect when the horizontal scrollbar appears and adjust each div accordingly? Thanks.
#header
{
position:absolute;
top:0;
left:0;
width:100%;
height:120px;
overflow:auto;
background:#FFFFFF;
}
The CSS for the container div is:
#container
{
position:fixed;
top:121px;
left:0;
bottom:30px;
right:0;
overflow:auto;
background:#FFFFFF;
padding:0px;
text-align:center;
}
And the CSS for the footer is:
#footer
{
position:absolute;
bottom:0;
left:0;
width:100%;
height:30px;
overflow:auto;
text-align:right;
}
When I resize the browser window to make it smaller, eventually horizontal scrollbars appear in the header DIV (the container and footer DIVs will eventually contain horizontal scrollbars if I continue to make the window smaller). The header DIV will also contains very small vertical scrollbars which are barely usable. When the horizontal scrollbars appear in the header, how can I adjust the DIVs so that the header div does not need the vertical scrollbar? It seems that if the header div is given more height and container div is shifted down,there would be no need for the vertical scrollbar. Is there a way of having the browser do this automatically or do I have to detect when the horizontal scrollbar appears and adjust each div accordingly? Thanks.