HTML CSS examples for CSS Layout:Responsive Layout
Two divs height 100% responsive when decrease
<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>