create bricks(divs) dynamically to make brick wall like layout - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

create bricks(divs) dynamically to make brick wall like 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">
.brick {<!--from  w  w  w  .  j  a va  2  s . com-->
   display:inline-block;
   padding:6px;
   background:red;
   margin:2px;
}
</style> 
 </head> 
 <body> 
  <div class="brick">
    Lorem 
  </div> 
  <div class="brick">
    Lorem ipsum do 
  </div> 
  <div class="brick">
    Lorem ipsum d 
  </div> 
  <div class="brick">
    Lorem 
  </div> 
  <div class="brick">
    Lorem ipsum do 
  </div> 
  <div class="brick">
    Lorem ipsum d 
  </div> 
  <div class="brick">
    Lorem 
  </div> 
  <div class="brick">
    Lorem ipsum do 
  </div> 
  <div class="brick">
    Lorem ipsum d 
  </div> 
  <div class="brick">
    Lorem 
  </div> 
  <div class="brick">
    Lorem ipsum do 
  </div> 
  <div class="brick">
    Lorem ipsum d 
  </div> 
  <div class="brick">
    Lorem 
  </div> 
  <div class="brick">
    Lorem ipsum do 
  </div> 
  <div class="brick">
    Lorem ipsum d 
  </div> 
  <div class="brick">
    Lorem 
  </div> 
  <div class="brick">
    Lorem ipsum do 
  </div> 
  <div class="brick">
    Lorem ipsum d 
  </div> 
  <div class="brick">
    Lorem 
  </div> 
  <div class="brick">
    Lorem ipsum do 
  </div> 
  <div class="brick">
    Lorem ipsum d 
  </div>  
 </body>
</html>

Related Tutorials