Yeah, I have an idea. Paul O'B has a "sticky footer" here on the CSS boards. I forget what thread it's in, but it's either in the 3 column CSS or CSS Tips and Tricks threads. Anyway here it is for good measure (I used EMs for this, and gave the footer a background color so you can see it more clearly).
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Sticky Footer at Bottom</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="screen,projection">
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
}
body {
background: #FFF;
color: #000;
font: normal 85%/140% "Lucida Console", Tahoma, Verdana, Arial, Helvetica, sans-serif;
}
#container {
margin-bottom: -3em;
}
* html #container {
height: 100%; /* IE 5.x and 6 don't understand min-height, but instead treat height as min-height */
}
html>body #container {
height: auto; /* for modern browsers as IE 5 and 6 treats height as min-height anyway */
min-height: 100%; /* squashes an IE 7 bug */
}
#clear-footer { /* needed to make room for the footer */
clear: both;
height: 3em;
}
#footer {
background: #8EF;
clear: both;
color: inherit;
height: 3em;
}
#footer p {
font-size: 0.85em;
padding-top: 1em;
text-align: center;
}
</style>
</head>
<body>
<div id="container">
<!-- the rest of your page HTML, such as the header, menu, page content, sidebar goes here -->
<div id="clear-footer"></div> <!-- need to make room for the footer -->
</div>
<div id="footer">
<p>
Copyright © 2006-2007, The Monster Under the Bed. All Rights To
Scare Unsuspecting Children Reserved.
</p>
</div>
</body>
</html>
Bookmarks