Negative bottom margins sticky footer - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer stick to bottom

Description

Negative bottom margins sticky footer

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,form {
   height:100%;
   margin:0;
   padding:0;
}

.wrapper {<!--   w w w  .j a  v  a 2 s.com-->
   min-height:100%;
   margin-bottom:-31px;
   padding:2px 0;
   box-sizing:border-box;
}

.footer,
.push {
   height:31px;
   overflow:hidden;
}
</style> 
 </head> 
 <body> 
  <form> 
   <div class="wrapper"> 
    <h1>Lorem ipsum dol</h1> 
    <div class="push"></div> 
   </div> 
   <footer class="footer"> 
    <p>Lorem ipsum dol</p> 
   </footer> 
  </form>  
 </body>
</html>

Related Tutorials