Create Flexbox columns without overlap - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Column

Description

Create Flexbox columns without overlap

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 {<!--   ww  w  .  j  av  a2s.  co  m-->
   height:100%;
}

body {
   height:100%;
   display:flex;
   flex-flow:column wrap;
}

h1 {
   padding:2em;
}

#content {
   padding:11px;
   background-color:Chartreuse;
   display:flex;
   flex-flow:row wrap;
   flex-grow:2;
}

#content>.group {
   margin:11px;
   padding:11px;
   border:2px solid yellow;
   background-color:blue;
   display:flex;
   flex-flow:row wrap;
   max-height:601px;
}

#content>.group .item {
   margin:11px;
   padding:11px;
   background-color:pink;
   width:201px;
}
</style> 
 </head> 
 <body> 
  <h1>Page Title</h1> 
  <div id="content"> 
   <div class="group"> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
   </div> 
   <div class="group"> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
   </div> 
   <div class="group"> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
    <div class="item">
      Item 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials