HTML CSS examples for CSS Layout:2 Column
Layout 2 div next to each other
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .element INPUT {<!--from ww w.j a v a 2 s . c o m--> -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; } .container { width:401px; padding:11px; } .element { margin-bottom:16px; height:41px; } .element div { vertical-align:top; height:41px; } .element div:first-child { float:left; width:100px; background-color:Chartreuse; } .element div:last-child { margin-left:100px; background-color:yellow; } .element INPUT { width:100%; } </style> </head> <body> <div class="container"> <div class="element"> <div> col 1 </div> <div> col 2 </div> </div> </div> <div class="container"> <div class="element"> <div> col 1 </div> <div> <input type="text"> </div> </div> </div> </body> </html>