Thread: Floating footer
View Single Post
Old 01-03-2013, 04:27 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,392
Thanks: 18
Thanked 351 Times in 350 Posts
sunfighter is on a distinguished road
Code:
<!DOCTYPE html>
<html lang="en">>
<head>
<title>Title of the document</title>
<style type="text/css">
html, body
{
	padding: 0;
	margin: 0;
	height: 100%;
}
#page
{
	min-height: 100%;  /* for all other browsers */
	height: 100%;  /* for IE */
	width: 960px;
	margin: auto;
}
#header
{
	background-color: pink;
	height: 75px;
}
#main
{
	padding-bottom: 75px;   /* This value is the height of your footer */
}
#footer
{
	background-color: green;
	position: absolute;
	width: 960px;
	bottom: 0;
	height: 75px;  /* This value is the height of your footer */
}
</style>
</head>

<body>
<div id="page">
      <div id="header">HEADER</div>
      <div id="main">A small amount of content.</div>
      <div id="footer">FOOTER</div>
</div>
</body>
</html>
sunfighter is offline   Reply With Quote