Css columns with last column filled - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Column Layout

Description

Css columns with last column filled

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

.columns {
   -webkit-column-count: 4; /* Chrome, Safari, Opera */
   -moz-column-count: 4; /* Firefox */
   column-count: 4;<!--  ww  w. jav  a2 s  .  c o m-->
}
.item {
   display:inline-block;
   border: 1px solid red;
}


      </style> 
 </head> 
 <body> 
  <div class="columns"> 
   <div class="item">
     Lorem ipsum dolor sit amet 2 
   </div> 
   <div class="item">
     Lorem ipsum dolor sit amet 3 
   </div> 
   <div class="item">
     Lorem ipsum dolor sit amet 4 
   </div> 
   <div class="item">
     Lorem ipsum dolor sit amet 5 
   </div> 
   <div class="item">
     Lorem ipsum dolor sit amet 6 
   </div> 
   <div class="item">
     Lorem ipsum dolor sit amet 7 
   </div> 
   <div class="item">
     Lorem ipsum dolor sit amet 8 
   </div> 
   <div class="item">
     Lorem ipsum dolor sit amet 8 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials