Make div grid by stacking them using float with min-height - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Float

Description

Make div grid by stacking them using float with min-height

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">
.boxContainer {<!--   w  ww  .  jav  a2  s . co m-->
   width:801px;
   height:auto;
}

.box {
   float:left;
   min-height:151px;
   width:401px;
   border:2px solid Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div class="boxContainer"> 
   <div class="box">
     1 
   </div> 
   <div class="box">
     2 
   </div> 
   <div class="box">
     3 
   </div> 
   <div class="box">
     4 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials