Two divs height 100% responsive when decrease - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Two divs height 100% responsive when decrease

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 {<!--   w ww . j av a2  s  . c  o  m-->
   background-color:Chartreuse;
   width:100%;
}

.one {
   background-color:yellow;
   display:inline-block;
   float:left;
   height:51px;
   width:51%;
}

.two {
   background-color:blue;
   display:inline-block;
   float:right;
   height:51px;
   width:51%;
}

@media screen and (max-width: 500px)  {
   .content1,
      .content2 {
      display:block;
      width:100%;
   }

}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="one"></div> 
   <div class="two"></div> 
  </div>  
 </body>
</html>

Related Tutorials