Vertical align complex multiple div site layout - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Alignment

Description

Vertical align complex multiple div site 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">
html, body {
   padding:0;
   margin:0;
   width:100%;
   height:100%;
   overflow:hidden;
}

.container {<!-- w  ww  .  j  a  v  a2 s . c  o  m-->
   width:651px;
   margin:0 auto;
}

.inner {
   position:absolute;
   top:51%;
   margin-top:-222px;
   width:651px;
}

#header {
   width:651px;
   height:88px;
   background-color:Chartreuse;
}

#navbar {
   width:651px;
   height:33px;
   background-color:yellow;
}

#content {
   width:501px;
   height:266px;
   background-color:blue;
   float:left;
}

#sidebar {
   width:151px;
   height:266px;
   background-color:pink;
   float:left;
}

#footer {
   width:651px;
   clear:left;
   height:59px;
   background-color:OrangeRed;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="inner"> 
    <div id="header">
      Lorem ip 
    </div> 
    <div id="navbar">
      Lorem ip 
    </div> 
    <div id="content">
      Lorem ips 
    </div> 
    <div id="sidebar">
      Lorem ips 
    </div> 
    <div id="footer">
      Lorem ip 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials