Auto-height, paneled layout in CSS - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

Auto-height, paneled layout in CSS

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <meta name="viewport" content="width=device-width"> 
  <style>
.top {
   height:100px;
   background:red;
   text-align:center;
}

.bottom {
   height:100px;
   background:green;
   text-align:center;
}

.middle {<!--from  w  w w . ja  v  a  2 s . co  m-->
   height:calc(100vh - 221px);
   background:yellow;
   text-align:center;
}
</style> 
 </head> 
 <body> 
  <div> 
   <div class="top">
     Lorem ipsum do 
   </div> 
   <div class="middle">
     Lorem ipsum d 
   </div> 
   <div class="bottom">
     Lorem ipsum do 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials