Create 3 by 2 grid based on div with CSS percentages - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div

Description

Create 3 by 2 grid based on div with CSS percentages

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">
#main_page_holder {<!-- w ww  .  ja  va  2  s .  com-->
   width:100%;
   height:100%;
}

#my {
   width:34.4%;
   height:51%;
   display:inline-block;
   background-color:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div id="main_page_holder"> 
   <div id="my">
     1 
   </div> 
   <div id="my">
     1 
   </div> 
   <div id="my">
     1 
   </div> 
   <div id="my">
     1 
   </div> 
   <div id="my">
     1 
   </div> 
   <div id="my">
     1 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials