Justify column in flex-box - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Column

Description

Justify column in flex-box

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 {
   height:100%;
}

.row {<!-- w ww  .  j  a va 2 s . com-->
   display:flex;
   flex-flow:row wrap;
   justify-content:center;
   background:grey;
   margin-bottom:21px;
}

.column {
   height:151px;
   overflow:hidden;
}

.column.fixed {
   flex:0 0 auto;
   width:100px;
   background:blue;
   height:151px;
}

.column.stretch {
   flex:2 2 100px;
   max-width:301px;
   min-width:100px;
   background:red;
}

p {
   width:100%;
}
</style> 
 </head> 
 <body> 
  <div class="row"> 
   <div class="column fixed"></div> 
   <div class="column stretch"></div> 
   <div class="column fixed"></div> 
  </div> 
  <div class="row"> 
   <div class="column fixed"></div> 
   <div class="column stretch"> 
    <p> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. </p> 
   </div> 
   <div class="column fixed"></div> 
  </div>  
 </body>
</html>

Related Tutorials