Style: Sharp - Website Template Tutorial
Centered, with 100% height, a sticky footer, and a sharp design - as always, it's bullet proof!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Style: Sharp</title> <style type="text/css"> <!-- /* ---------------------------------------------------- Style: Sharp Author: Eric Watson Website: http://www.websitecodetutorials.com ------------------------------------------------------- : Site Colors : : Table Of Contents : Resets Defaults Typography Forms Layout Links Menus Global Classes Content ---------------------------------------------------- */ /* -------------------- Resets --------------------- */ body, address, blockquote, dl, ol, ul, li, form, fieldset, h1, h2, h3, h4, h5, h6, p, pre { margin: 0; padding: 0; } fieldset, table { border: none; } /* --------------- Document Defaults -------------- */ html { font-size: 100.01%; height: 100%; } body { height: 100%; font: 62.5%/1.5 Arial, Helvetica, 'MS Sans Serif', sans-serif; background: #666; color: #000; text-align: center; } /* ------------------ Typography ------------------- */ h1 { font-size: 2.6em; text-align: center; padding: 33px 0 0; } h2 { font-size: 1.8em; margin: 1em 0 0; } p { margin: 0 0 1em; font-size: 1.2em; } ul { list-style: none; font-size: 1.2em; font-weight: bold; } /* -------------------- Forms ---------------------- */ /* -------------------- Layout --------------------- */ * html #wrapper { height: 100%; } #wrapper { margin: 0 auto; width: 720px; min-height: 100%; background-color: #CCC; text-align: left; border-left: 1px solid #000; border-right: 1px solid #000; } #header { height: 120px; border-bottom: 1px solid #000; } #nav { position: relative; background-color: #666; text-align: center; width: 722px; margin: 0 -1px; line-height: 1.25; } #content { padding: 60px 80px; /* only use padding on #content, not margin, or it moves the top border */ border-top: 1px solid #000; } #clearfooter { height: 70px; } #footerborder { height: 1px; width: 640px; background-color: #000; margin: 0 40px; border-bottom: 1px solid #FFF; } #footer { height: 70px; width: 720px; text-align: center; margin: -71px auto 0; } /* -------------------- Links ---------------------- */ /* --------------------- Menus --------------------- */ /* Main Menu */ /* Footer Menu */ /* ---------------- Global Classes ----------------- */ /* ----------------- Content/Pages ----------------- */ --> </style> </head> <body> <div id="wrapper"> <div id="header"> <h1>Header</h1> </div> <div id="nav"> <ul> <li>Nav</li> </ul> </div> <div id="content"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque tempor. Nam in libero vel nisi accumsan euismod. Quisque quis neque. Donec condimentum, enim convallis vestibulum varius, quam mi accumsan diam, sollicitudin ultricies odio ante vitae purus. Etiam ultricies quam. Vestibulum turpis turpis, fermentum ut, accumsan quis, tempor at, ipsum. Nam felis elit, sollicitudin id, ultrices faucibus, fringilla vel, dui. Aliquam tincidunt iaculis eros. Sed in lorem. Nullam eu enim. Quisque tristique pretium diam. Fusce tempor sollicitudin ligula. Donec purus eros, mattis quis, mattis vestibulum, congue quis, felis. Nulla facilisi. Nam ultricies posuere justo. In feugiat.</p> <p>Ut lacus neque, interdum in, nonummy ac, placerat a, lorem. In interdum vulputate lectus. Aenean libero elit, eleifend id, tincidunt id, tristique eu, tortor. Pellentesque urna dolor, placerat a, pharetra eget, congue ut, ligula. Sed mi. Nunc volutpat. Donec pharetra accumsan lacus. Integer pede orci, vehicula vitae, porttitor id, pulvinar vel, nisi. Aliquam mauris ligula, eleifend sit amet, eleifend sit amet, luctus at, turpis. Sed neque orci, tincidunt id, tempus condimentum, eleifend a, nisl. Etiam auctor. Donec lectus lacus, consequat ac, ultrices venenatis, imperdiet vel, erat. In porttitor augue at tellus commodo pharetra.</p> </div> <div id="clearfooter"> </div> </div><!-- end #wrapper --> <div id="footer"> <div id="footerborder"><!-- the comment itself is needed for IE6 --></div> <h2>Footer</h2> </div> </body> </html>