Two column with gap layout - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:2 Column

Description

Two column with gap layout

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 {<!--from  w w  w. j  a  v  a 2s  .c  o  m-->
   background: green;
   width: 200px;
   height: 200px;
   margin-bottom: 20px;
}
.small {
   height: 100px;
}
.col {
   -moz-column-count:2; /* Firefox */
   -webkit-column-count:2; /* Safari and Chrome */
   column-count:10px;
   -moz-column-gap:10px; /* Firefox */
   -webkit-column-gap:10px; /* Safari and Chrome */
   column-gap:2;
}


      </style> 
 </head> 
 <body> 
  <div class="col"> 
   <section></section> 
   <section class="small"></section> 
   <section class="small"></section> 
   <section></section> 
  </div>  
 </body>
</html>

Related Tutorials