Monday 16 August 2010

Fixed body and footer

This example combines a fixed body and footer height. Commonly used on designer websites.

See demo.

<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset="UTF-8">
<title>Fixed body</title>
<style type="text/css">
*
{
margin:0;
padding:0;
}
body
{
background:#A3A3A3;
}
#container, footer
{
display:block;
font-family:Sans-serif;
}
#container
{
 background:#FFFFFF;
 color:#A3A3A3;
 height:400px;
}
footer
{
 height:10em;
 background:#A3A3A3;
 color:#FFFFFF;
}
</style>
</head>
<body>
<div id="container">
 <h1>This is a sticky footer example</h1>
</div>
<footer>This is my footer</footer>
</body>
</html>

No comments:

Post a Comment