#footer on page bottom
要点:
<div id="footer">
<p>This is some #footer content</p>
</div>
#footer{
position:absolute;
width:100%; /* abs. el. loose width, so regain */
bottom:0px;
padding: 20px 15px;
background:#bada55;
}
#footer on page bottom with Centered Content
要点:
<div id="footer">
<div>
<p>This is some Centered #footer content</p>
</div>
</div>
#footer{
position:absolute;
width:100%; /* abs. el. loose width, so regain */
bottom:0px;
background:#bada55;
}
#footer > div{
margin:0 auto;
width: 600px;
padding:20px 15px; /* padding here, now #footer is only a marionette :) */
background:#cf5;
}
Example with page content
要点:
<div id="page">
<p>This is some Centered #page content my 100px padding bottom will prevent the content to end up behing the #footer applying properly the vertical window scrollbars once I touch the very page bottom.</p>
</div>
<div id="footer">
<div>
<p>This is some Centered #footer content</p>
</div>
</div>
#page{
margin: 0 auto;
width:600px;
padding:20px 15px 100px;
background:#eee; /* BG is just for example, avoid BG on this element, rather create an inner one*/
}
#footer{
position:absolute;
width:100%; /* abs. el. loose width, so regain */
bottom:0px;
background:#bada55;
}
#footer > div{
margin:0 auto;
padding:20px 15px; /* padding here, now #footer is only a marionette :) */
width: 600px;
background:#cf5;
}