<!-- html5 shiv for IE8 and under -->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- If you aren't using jquery you can use the body element instead (body{width:100%;display:table;height:100%})of the #wrap div as jquery has a bug (
http://bugs.jquery.com/ticket/7261) in webkit when the body is display:table. -->
<div id="wrap">
<header><h1>Cabeçalho (Funciona no FF, IE 8+, Chrome)</h1></header>
<main class="content">
Conteúdo aqui
</main>
<footer class="footer"><p>Rodapé</p></footer>
</div>
CSS
html, body,#wrap {margin:0; padding:0; height:100%;}
#wrap {display:table;width:100%}
/* if ie7 support is needed then set height of #wrap and header and footer to auto in CC's and just let it have a normal layout (or: *+html #wrap{height:auto})*/
.content { background:#ccc; }
header { background:#999; color:#fff; text-align:center; padding:10px 0}
header, .footer, main { display:block}/* ie7 and under*/
header, .footer, main { display:table-row }
/* height 1px on the header and footer is the sticky footer technique */
header, .footer{height:1px}
h1{padding:10px;margin:0;}
.footer {background:#999; color:#fff; text-align:center;}
.footer p { margin:0; padding:10px}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.