Div height 100% to footer - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Footer

Description

Div height 100% to 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 {
   margin:0;
   padding:0;
   height:100%;
   background:Chartreuse;
}

#container {<!--from   ww  w . ja v a2s . c  o m-->
   min-height:100%;
   position:relative;
}

#header {
   padding:11px;
   height:166px;
   width:71%;
   margin-left:auto;
   margin-right:auto;
   background:yellow;
}

#header, #footer, #content {
   box-sizing:border-box;
}

#content {
   padding:11px;
   padding-bottom:100px;
   width:71%;
   left:16%;
   margin-left:auto;
   margin-right:auto;
   background:blue;
   position:absolute;
   bottom:100px;
   top:166px;
}

#footer {
   position:absolute;
   bottom:0;
   width:100%;
   height:100px;
   width:71%;
   left:16%;
   background:pink;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="header"></div> 
   <div id="content"></div> 
   <div id="footer"></div> 
  </div>  
 </body>
</html>

Related Tutorials