Using divs as a grid - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div Table

Description

Using divs as a grid

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">
.row {<!-- www .ja va 2s . c  o  m-->
   width:961px;
   margin:0 auto;
   text-align:left;
}

.wrapper {
   color:Chartreuse;
   width:955px;
   height:auto;
   margin:0 4px 4px 4px;
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png');
}

.wrapper p {
   padding:16px;
}

div.grid1 {
   width:235px;
   margin:4px;
   float:left;
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png');
}

div.gridbreak{
}
div.grid1 img {
}
div.grid1 p {
   text-align:center;
   padding:16px;
}
</style> 
 </head> 
 <body> 
  <div class="row"> 
   <div class="wrapper content"> 
    <p>Lore</p> 
   </div> 
  </div> 
  <div class="row"> 
   <div class="grid1"> 
    <a href="#"> <p>Lorem ipsum d</p> </a> 
   </div> 
   <div class="grid1"> 
    <a href="#"> <p>Lorem ipsum d</p> </a> 
   </div> 
   <div class="grid1"> 
    <a href="#"> <p>Lorem ipsum dol</p> </a> 
   </div> 
   <div class="grid1"> 
    <a href="#"> <p>Lorem ipsum do</p> </a> 
   </div> 
   <div class="grid1"> 
    <a href="#"> <p>Lorem ipsum do</p> </a> 
   </div> 
   <div class="grid1"> 
    <a href="#"> <p>Lorem ipsum d</p> </a> 
   </div> 
   <div class="grid1"> 
    <a href="#"> <p>Lorem ipsum dol</p> </a> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials