Create row span like layout with flexbox - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Row

Description

Create row span like layout with flexbox

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Flexbox grid</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

.container {<!--  w  w  w.jav a2s . c o  m-->
   display: flex;
   flex-direction: column;
   width: 100%;
   height: 300px;
   flex-wrap: wrap;
}
.item {
   border: 2px solid #ddd;
   padding: 20px;
   background: grey;
   height: 50%;
   width: 25%;
   box-sizing: border-box;
}
.item:nth-child(1) {
   width: 50%;
   height: 100%;
}


      </style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="item">
     1 
   </div> 
   <div class="item">
     2 
   </div> 
   <div class="item">
     3 
   </div> 
   <div class="item">
     4 
   </div> 
   <div class="item">
     5 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials