HTML CSS examples for CSS Layout:Responsive Layout
Keep responsive divs side by side when one div contains a fixed size background image
<html> <head> <title>Lorem ipsum </title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> body {<!--from w w w. j a v a 2s. c o m--> margin:0; } .containersearch { border:2px solid Chartreuse; background:yellow; padding:6px 6px 6px 6px; width:100% border-bottom-left-radius:9px; border-bottom-right-radius:9px; } input[type=text] { width:100%; box-sizing:border-box; border:3px solid blue; border-radius:5px; font-size:17px; background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png'); background-repeat:no-repeat; background-position:right; background-color:pink; padding:13px 21px 13px 11px; } input[type=text]:focus { width:100%; } </style> </head> <body> <div class="containersearch"> <form> <input type="text" name="search" placeholder="Search.."> </form> </div> </body> </html>