Layout middle column with fixed-width, two outer columns fluid width, no spacing - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:2 Column

Description

Layout middle column with fixed-width, two outer columns fluid width, no spacing

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 {
   width:100%;
   height:100%;
   margin:0;
   padding:0;
}
div {<!--from  w  w  w  .j  a  va  2s .  com-->
   height:300px;
   border:1px solid red
}
.container {
   display:table;
   width:100%;
   height:100%;
   table-layout:fixed;
}
.left, .right, .cent {
   display:table-cell;
   text-align:center;
   vertical-align:middle
}
.cent {
   width:225px;
}
.left {
   width : calc(30% - 225px);
}
.right{
   width : calc(70% - 225px);
}


      </style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="left">
     1-2-3-4-5-6-7-8-9-10 
   </div> 
   <div class="cent">
     test test test test test test test
   </div> 
   <div class="right">
     1-2-3-4-5-6-7-8-9-10-11-12-13 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials