Create 3 div's with middle div taking up remaining width - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Width

Description

Create 3 div's with middle div taking up remaining width

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">
#container {<!--from  www  .  j a  v  a2s. c  o m-->
   display:table;
   width:100%;
}

#left, #middle, #right {
   display:table-cell;
   height:100px;
}

#left, #right {
   width:151px;
   background:lime;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="left"></div> 
   <div id="middle"></div> 
   <div id="right"></div> 
  </div>  
 </body>
</html>

Related Tutorials