Keeping footer at the bottom of the page - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer aligned bottom

Description

Keeping footer at the bottom of the page

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
html,body {
   margin:0;
   padding:0;
   height:100%;
}

div#container {<!--   w  w  w  .  j ava2s .c  o m-->
   position:relative;
   margin:0 auto;
   width:751px;
   height:auto !important;
   height:100%;
   min-height:100%;
}

div#header {
   height:151px;
   background-color:Chartreuse;
}

div#content {
   padding-bottom:151px;
   height:801px;
   background-color:yellow;
}

div#footer {
   position:absolute;
   width:100%;
   bottom:0;
   height:151px;
   background-color:blue;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="header"></div> 
   <div id="content"></div> 
   <div id="footer"></div> 
  </div>  
 </body>
</html>

Related Tutorials