Responsive Design for 4 DIVs - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Responsive Design for 4 DIVs

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">
.wrap {<!-- ww w. ja  v  a  2  s . c o m-->
   text-align:center;
   margin:16px auto;
}

.resp {
   display:inline-block;
   text-align:left;
   width:22%;
   margin-right:2%;
}

.resp.fixed {
   width:100px;
   margin-right:11px;
}

#a {
   background:Chartreuse;
   color:yellow;
}

#b {
   background:blue;
   color:pink;
}

#c {
   background:OrangeRed;
   color:grey;
}

#d {
   background:BlueViolet;
   color:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div class="wrap"> 
   <div id="a" class="resp">
     Lorem ip 
   </div> 
   <div id="b" class="resp">
     Lorem ip 
   </div> 
   <div id="c" class="resp">
     Lorem ips 
   </div> 
   <div id="d" class="resp">
     Lorem ip 
   </div> 
  </div> 
  <div class="wrap"> 
   <div id="a" class="resp fixed">
     Lorem ip 
   </div> 
   <div id="b" class="resp fixed">
     Lorem ip 
   </div> 
   <div id="c" class="resp fixed">
     Lorem ips 
   </div> 
   <div id="d" class="resp fixed">
     Lorem ip 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials