dghosh2602
07-23-2008, 12:55 PM
Hello,
I am trying to place 3 divs on a page: header, content, footer. I need the header to be always seen across page scrolls. I want content start after header and footer to start after content as normally expected. Content are must be fluid, in the sense that it shouldn't have a height specified. It should depend on the content placed in it and the footer needs to have a height.
I got the header and content parts behaving as I expect but I am messing up the footer. I can't seem to make it follow the content automatically.
Below is my code:
HTML:
<body>
<div id="header">
<div class="innertube">
<xsl:apply-templates select="header" />
</div>
</div>
<div id="content">
<div class="innertube">
<xsl:apply-templates select="content" />
</div>
</div>
<div id="footer">
<div class="innertube">
<xsl:apply-templates select="footer" />
</div>
</div>
</body>
CSS:
body {
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
height: 100%;
max-height: 100%;
}
#header {
/***** Always Visible *****/
position: absolute;
top: 0;
left: 0;
width: 100%;
/***** Height Of Frame Div *****/
height: 58px;
background: url(../images/header_bg1.png) repeat-x;
/***** Disable scrollbars. Set to "scroll" to enable *****/
overflow: none;
/***** Shiny Silver *****/
background-color: #3A4046;
color: #FFFFFF;
}
#content {
position: fixed;
/***** Set this value, equal to the height of the header frame *****/
top: 58px;
left: 0;
right: 0;
bottom: 0;
overflow: auto;
padding: 10px 10px 10px 10px;
background: #FFFFFF;
}
#footer {
background: url(../images/footer1.png) repeat-x;
padding: 10px 10px 10px 10px;
color: white;
height: 49px;
width: 100%;
}
Please help,
Thanks a lot!
I am trying to place 3 divs on a page: header, content, footer. I need the header to be always seen across page scrolls. I want content start after header and footer to start after content as normally expected. Content are must be fluid, in the sense that it shouldn't have a height specified. It should depend on the content placed in it and the footer needs to have a height.
I got the header and content parts behaving as I expect but I am messing up the footer. I can't seem to make it follow the content automatically.
Below is my code:
HTML:
<body>
<div id="header">
<div class="innertube">
<xsl:apply-templates select="header" />
</div>
</div>
<div id="content">
<div class="innertube">
<xsl:apply-templates select="content" />
</div>
</div>
<div id="footer">
<div class="innertube">
<xsl:apply-templates select="footer" />
</div>
</div>
</body>
CSS:
body {
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
height: 100%;
max-height: 100%;
}
#header {
/***** Always Visible *****/
position: absolute;
top: 0;
left: 0;
width: 100%;
/***** Height Of Frame Div *****/
height: 58px;
background: url(../images/header_bg1.png) repeat-x;
/***** Disable scrollbars. Set to "scroll" to enable *****/
overflow: none;
/***** Shiny Silver *****/
background-color: #3A4046;
color: #FFFFFF;
}
#content {
position: fixed;
/***** Set this value, equal to the height of the header frame *****/
top: 58px;
left: 0;
right: 0;
bottom: 0;
overflow: auto;
padding: 10px 10px 10px 10px;
background: #FFFFFF;
}
#footer {
background: url(../images/footer1.png) repeat-x;
padding: 10px 10px 10px 10px;
color: white;
height: 49px;
width: 100%;
}
Please help,
Thanks a lot!