Change CSS column balancing with three columns - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:3 Column

Description

Change CSS column balancing with three columns

Demo Code

ResultView the demo in separate window

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

#columns {
   /*-webkit-column-count: 3;*/
   /* Chrome, Safari, Opera */
   /*-moz-column-count: 3;*/
   /* Firefox */<!--  w  w  w  .j ava 2s. co  m-->
   /*column-count: 3;
   -webkit-column-gap: 1em;
   -moz-column-gap: 1em;
   column-gap: 1em;*/
}
.content {
   border: 1px solid black;
   display: inline-block;
   height: 100px;
   width: 31%;
   margin-right: 2%;
}
.content:nth-of-type(3n+0) {
   margin-right: 0;
}


      </style> 
 </head> 
 <body> 
  <div id="columns"> 
   <div class="content">
     div-1 
   </div> 
   <div class="content">
     div-2 
   </div> 
   <div class="content">
     div-3 
   </div> 
   <div class="content">
     div-4 
   </div> 
   <div class="content">
     div-5 
   </div> 
   <div class="content">
     div-6 
   </div> 
   <div class="content">
     div-7 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials