align grids and margin to left and right edge equally - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Grid

Description

align grids and margin to left and right edge equally

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">
.container {<!--from w  ww. ja  v a  2s  .co  m-->
   position:relative;
   width:601px;
   margin:0 auto;
}

.box {
   float:left;
   width:161px;
   height:81px;
   background:Chartreuse;
   margin:21px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="box">
     Lorem i 
   </div> 
   <div class="box">
     Lorem i 
   </div> 
   <div class="box">
     Lorem i 
   </div> 
   <div class="box">
     Lorem i 
   </div> 
   <div class="box">
     Lorem i 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials