Css floating footer margin - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer

Description

Css floating footer margin

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">
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
   margin:0;
   padding:0;
}

#header {<!-- www  .ja v a  2s.c  o  m-->
   border-top:21px solid Chartreuse;
   height:34px;
   line-height:34px;
   text-align:center;
   background-color:yellow;
}

html {
   height:100%;
}

body {
   height:100%;
   width:91%;
   margin:auto;
}

#wrap {
   min-height:100%;
   background-color:blue;
}

#main {
   overflow:auto;
   padding-bottom:54px;
   background-color:pink;
   height:91%
}

#footer {
   position:relative;
   margin-top:-54px;
   height:34px;
   line-height:34px;
   border-bottom:21px solid OrangeRed;
   text-align:center;
   background-color:grey;
}
</style> 
 </head> 
 <body> 
  <div id="wrap"> 
   <div id="header">
     Lorem ip 
   </div> 
   <div id="main">
     Lorem 
    <br>Lorem 
    <br>Lorem 
    <br>Lorem 
    <br>Lorem 
    <br>Lorem 
    <br> 
   </div> 
  </div> 
  <div id="footer">
    Lorem ip 
  </div>  
 </body>
</html>

Related Tutorials