Set Content area height to 100% including header - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Header

Description

Set Content area height to 100% including header

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:100%;margin:0px;}
#header{height:80px;background:black;}
#mainView{height:100%; background:red;}
#header {<!--   w  w w.j  ava2s. co m-->
   height:80px;
   background:black;
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
}
#mainView {
   height:100%;
   background:red;
   padding-top: 80px;
   box-sizing: border-box;
   -moz-box-sizing: border-box;
   -webkit-box-sizing: border-box;
}
      </style> 
 </head> 
 <body> 
  <div id="header">
    --Header 
  </div> 
  <div id="mainView">
    --Main 
  </div>  
 </body>
</html>

Related Tutorials