Responsive design layout for div grid - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Responsive design layout for div 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">
.container {<!--from   w w  w  .jav a2s .  c om-->
   position:relative;
   width:100%;
   max-width:91%;
   margin:0px auto;
   margin-top:6%;
   overflow:hidden;
}

.coverItem {
   float:left;
   width:100%;
   position:relative;
   border-radius:6%;
   -webkit-border-radius:6%;
   -moz-border-radius:6%;
   background-color:Chartreuse;
}

.coverItem:nth-child(1) {
   max-width:37%;
   padding-top:36%;
   margin-right:0.6%;
}

.coverItem:nth-child(2) {
   max-width:33%;
   padding-top:18.3%;
   margin-right:0.6%;
}

.coverItem:nth-child(3) {
   max-width:23.8%;
   padding-top:18.3%;
   margin-bottom:0.6%;
}

.coverItem:nth-child(4) {
   max-width:18.3%;
   padding-top:18.3%;
}

.coverItem:nth-child(5) {
   max-width:20.7%;
   padding-top:18.3%;
   margin-left:0.6%;
}

.coverItem:nth-child(6) {
   max-width:18.3%;
   padding-top:18.3%;
   margin-left:0.6%;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="coverItem"></div> 
   <div class="coverItem"></div> 
   <div class="coverItem"></div> 
   <div class="coverItem"></div> 
   <div class="coverItem"></div> 
   <div class="coverItem"></div> 
  </div>  
 </body>
</html>

Related Tutorials