Add a horizontal line separator on rows of wrapping items with flex layout - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Wrap

Description

Add a horizontal line separator on rows of wrapping items with flex layout

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Flex-box row border</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
div.flexbox {<!-- w  w w  .ja v  a2 s  .c om-->
   border-left:2px solid Chartreuse;
   border-top:2px solid yellow;
   border-right:2px solid blue;
   width:51%;
   display:flex;
   flex-flow:row wrap;
   align-items:stretch;
}

span {
   border:2px solid pink;
   margin:6px;
}

.wrap {
   border-bottom:2px solid WhiteSmoke;
   padding:6px;
   flex-grow:2;
}

#last {
   flex-grow:1001;
}
</style> 
 </head> 
 <body> 
  <div class="flexbox"> 
   <div class="wrap"> 
    <span>First item</span> 
   </div> 
   <div class="wrap"> 
    <span>Second item</span> 
   </div> 
   <div class="wrap"> 
    <span>Third item</span> 
   </div> 
   <div class="wrap"> 
    <span>Fourth item</span> 
   </div> 
   <div class="wrap"> 
    <span>Fifth item</span> 
   </div> 
   <div class="wrap"> 
    <span>Sixth item</span> 
   </div> 
   <div class="wrap"> 
    <span>Seventh item</span> 
   </div> 
   <div class="wrap"> 
    <span>Eigth item</span> 
   </div> 
   <div class="wrap"> 
    <span>Nineth item</span> 
   </div> 
   <div class="wrap"> 
    <span>tenth item</span> 
   </div> 
   <div id="last" class="wrap"> 
    <span>Eleventh item</span> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials