Footer staying at the bottom for long content - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer aligned bottom

Description

Footer staying at the bottom for long content

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 {<!--   w w  w  .  j av  a 2  s. com-->
   position:relative;
   min-height:100%;
}

body {
   margin:0 0 61px 0;
}

.content {
   background:green;
   height:201px;
}

footer {
   position:absolute;
   bottom:0;
   left:0;
   width:100%;
   height:61px;
   background-color:Chartreuse;
   background-color:yellow;
}
</style> 
 </head> 
 <body> 
  <div class="wrapper"> 
   <main class="content">
     Lorem ips 
   </main> 
   <footer class="footer">
     Lorem ip 
   </footer> 
  </div>  
 </body>
</html>

Related Tutorials