In Flexbox, 2 items aligned left, a 3rd item aligned right and stretching the full height of its container - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Height

Description

In Flexbox, 2 items aligned left, a 3rd item aligned right and stretching the full height of its container

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 {<!-- ww w  . j a  v  a2 s  . c o  m-->
   display:flex;
}

.col {
   flex:2;
   display:flex;
   flex-direction:column;
   margin-left:6px;
}

.col:first-child {
   margin-left:0px;
}

.box {
   margin-top:6px;
   padding:0px 16px;
   box-sizing:border-box;
   width:100%;
   background-color:Chartreuse;
   flex:2;
}

.box:first-child {
   margin-top:0px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="col"> 
    <div class="box"> 
     <p>one is</p> 
     <p>tall</p> 
    </div> 
    <div class="box"> 
     <p>two</p> 
     <p>is</p> 
     <p>taller</p> 
    </div> 
   </div> 
   <div class="col"> 
    <div class="box"> 
     <p>three stretches</p> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials