HTML Layout - Keep wrapper height 100% even with no content - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

HTML Layout - Keep wrapper height 100% even with no 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, body
 {
   height:auto;
   background-color:Chartreuse;
   position:relative;
   margin:0;
}

#header<!--from   ww  w .ja v a  2 s. c om-->
 {
   position:absolute;
   width:auto;
   min-width:100%;
   height:76px;
   background-color:yellow;
}

#wrap
 {
   position:relative;
   width:auto;
   min-width:100%;
   min-height:100vh;
   background-color:blue;
   margin:76px 0 0 0;
}

footer
 {
   position:absolute;
   width:auto;
   min-width:100%;
   height:51px;
   background-color:pink;
}
</style> 
 </head> 
 <body> 
  <div id="header"> 
   <div> 
    <div id="wrap"></div> 
    <footer></footer> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials