Multiple divs responsive with css - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Multiple divs responsive with css

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">
html, body {
   height:100%;
}

.custom_div {
   width:100%;
}

.custom_div div {
   background:Chartreuse;
   box-sizing:border-box;
   -moz-box-sizing:border-box;
}

#one, #two {<!--  w  w  w  . j av  a2s  . c  o m-->
   width:51%;
   float:left;
   height:100%;
}

.clearfix {
   clear:both;
   display:block;
}

@media screen and (max-width: 960px)  {
   #one, #two {
      width:auto;
      float:none;
   }

}
</style> 
 </head> 
 <body> 
  <div class="custom_div"> 
   <div id="one">
     Lorem 
    <br>Lorem i 
    <br>Lorem ipsum dolor s 
    <br>Lorem ipsum dol 
   </div> 
   <div id="two">
     Lorem 
   </div> 
   <div id="three" class="clearfix">
     Lorem i 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials