Keep the Search button next to the input bar when resizing using % - HTML CSS CSS Form

HTML CSS examples for CSS Form:input button

Description

Keep the Search button next to the input bar when resizing using %

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">

#searchbartop {<!-- www  . j a  va2  s.  com-->
   margin:auto;
   vertical-align:middle;
   margin-left:25%;
   width:75%;
}
#searchbartop input[type=text] {
   width:70%;
   padding-right: .5em;
   display:block;
   float:left;
}
#searchbartop input[type=button] {
   width:20%;
   display:block;
   float:left;
}


      </style> 
 </head> 
 <body> 
  <form id="searchbartop"> 
   <input type="text" placeholder="Search..." required> 
   <input type="button" value="Search"> 
  </form>  
 </body>
</html>

Related Tutorials