Center content with scrollbar layout - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

Center content with scrollbar layout

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">
#navbar {<!--   w  w w . j  a  va2s. co m-->
   background-color:Chartreuse;
   color:yellow;
   position:absolute;
   top:0;
   left:0;
   right:0;
   height:26px;
}

#tabs {
   background-color:blue;
   color:pink;
   position:absolute;
   top:26px;
   left:0;
   right:0;
   height:26px;
}

.tab {
   float:left;
   padding:0 2em;
   height:26px;
}

#footer {
   background-color:OrangeRed;
   color:grey;
   position:absolute;
   bottom:0;
   left:0;
   right:0;
   height:26px;
}

#content {
   background-color:BlueViolet;
   color:Chartreuse;
   position:absolute;
   top:51px;
   bottom:26px;
   left:0;
   right:0;
   overflow-y:scroll;
}
</style> 
 </head> 
 <body> 
  <div id="navbar">
    Lorem ipsum dolo 
  </div> 
  <div id="tabs"> 
   <div class="tab">
     Lorem 
   </div> 
   <div class="tab">
     Lorem 
   </div> 
  </div> 
  <div id="content"> 
   <p>Lorem ipsum dolor sit a</p> 
  </div> 
  <div id="footer">
    Lorem ip 
  </div>  
 </body>
</html>

Related Tutorials