push a footer to the bottom of page when content is short - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer aligned bottom

Description

push a footer to the bottom of page when content is short

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 {
   height:100%;
}

#wrapper {<!--  w ww.j  a  v a  2  s.  c o  m-->
   min-height:100%;
   height:auto !important;
   height:100%;
   margin:0 auto -31px;
}

#bottom, #push {
   height:31px;
}

body {
   background:Chartreuse;
}

#header {
   height:31px;
   background:yellow;
   color:blue;
}

#footer {
   height:31px;
   background:pink;
   color:OrangeRed;
}
</style> 
 </head> 
 <body> 
  <div id="wrapper"> 
   <div id="header">
     Lorem ip 
   </div> 
   <div id="push"></div> 
  </div> 
  <div id="bottom"> 
   <div id="footer">
     Lorem ip 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials