Forum Moderators: not2easy
I don't have a huge monitor to test this on, but it looks as if even if you stretched this page vertically indefinitely it would keep the coral at the bottom. That's what I want to do with a footer.
So would "position: absolute; bottom: 0px;" ensure that it would look good even on large monitors?
Since the footer I'm making will be part of a template for many pages on the site I want to ensure that for pages with little content there will not be a gap between the footer and the bottom of the browser window, if you get what I mean.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css">
body {
margin-top: 0;
margin-bottom: 0;
}body, html {
height: 100%;
}
</style>
</head><body>
<div style="min-height: 100%; _height: 100%">
<!-- Padding-bottom is the same value as the total height of the footer -->
<div style="padding-bottom: 5em">
<div style="float: left"><h1>Footer at Bottom</h1>
<img src="blank.gif" width="500" height="90" border="1">
</div><!--style="float: left"--><div style="clear: both"></div>
</div><!--style="padding-bottom: 5em"-->
</div><!--style="min-height: 100%;"--><!-- By using a negative margin-top we move the footer up the same amount as the footer height to avoid vertical scrolling. Remember, if you use borders and padding on your footer you will have to calculate this in your negative margin-top value also. -->
<div id="footer" style="margin: 0; height: 5em; margin-top: -5em">
<div style="clear: both"></div>
<p style="margin: 0">This is our footer</p>
</div><!--id="footer"-->
</body>
</html>
[edited by: swa66 at 5:30 pm (utc) on April 8, 2009]
[edit reason] No URLs please see ToS and forum charter [/edit]