Multiline-flexbox - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Flex Container

Description

Multiline-flexbox

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">

section {<!--  www .ja v a2  s .c  o  m-->
   display: -webkit-flex;
   display: flex;
   -webkit-flex-direction: row;
   flex-direction: row;
   -webkit-flex-wrap: wrap;
   flex-wrap: wrap;
   width: 100%;
   box-sizing:border-box;
   margin:0;
}
.box {
   border: 1px solid black;
   background: #ccc;
   display: block;
   -webkit-flex-basis: calc(50% - 2px);
   flex-basis: calc(50% - 2px);
   margin:0;
}


      </style> 
 </head> 
 <body> 
  <section> 
   <div class="box">
     1 
   </div> 
   <div class="box">
     2 
   </div> 
   <div class="box">
     3 
   </div> 
   <div class="box">
     4 
   </div> 
  </section>  
 </body>
</html>

Related Tutorials