Three Column Layout with the third column taking the rest - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:3 Column

Description

Three Column Layout with the third column taking the rest

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<!--   w  w w . j  a v a 2 s .co  m-->
{
   width: 740px;
   height: 300px;
   display: flex;
   background-color: green;
}
.Container div:first-child
{
}
.Container div:nth-child(2)
{
   background-color: yellow;
   flex: 0 0 130px;
}
.Container div:nth-child(3)
{
   background-color: blue;
   flex: 0 0 auto;
}


      </style> 
 </head> 
 <body> 
  <div style="width: 740px; height: 300px; display: flex;"> 
   <div style="background-color: red; flex: 1 0 auto;">
     COL 1 Im taking all the rest 
   </div> 
   <div style="background-color: yellow; flex: 0 0 130px;">
     COL 2 
   </div> 
   <div style="background-color: blue; flex: 0 0 auto;">
     COL 3 I'm taking excatly what i need 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials