HTML CSS examples for CSS Layout:Responsive Layout
Responsive CSS / Inline divs
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> * {<!--from w w w .j av a2 s . com--> margin:0; padding:0; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; } .wrap { border:2px solid Chartreuse; } .wrap div { border:2px solid yellow; height:31px; width:51%; float:left; } .clear:after { content:""; display:table; clear:both; } @media all and (max-width: 400px) { div.wrap div { width:100%; float:none; } } </style> </head> <body> <div class="wrap clear"> <div></div> <div></div> </div> </body> </html>