<div id="header">Header Info</div>
<div id="content">
<img src='http://i.imgur.com/Fl33AV8.png' ></img>
</div>
<!-- Post Info -->
<div style='position:fixed;bottom:0;left:0;
background:lightgray;width:100%;'>
Further Reading: <a href='http://stackoverflow.com/a/10975357/1366033'>position fixed header in html</a>
<div>
CSS
#header {
position:fixed; /* fixing the position takes it out of html flow - knows
nothing about where to locate itself except by browser
coordinates */
left:0; /* top left corner should start at leftmost spot */
top:0; /* top left corner should start at topmost spot */
width:100%; /* take up the full browser width */
z-index:200; /* high z index so other content scrolls underneath */
height:100px; /* define height so you can define for content */
background-color:brown; /* otherwise content underneath will be visible */
}
#content {
min-height:100%;
width:960px;
margin:0 auto;
margin-top:130px; /* add top margin so doesn't hide under header */
}
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.
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!
Console
Debug your Fiddle with a minimal built-in JavaScript console.