The best way to do this now (2019) is with a flexbox.
Run the snippet below to see what you get.
form {_x000D_
/* This bit sets up the horizontal layout */_x000D_
display:flex;_x000D_
flex-direction:row;_x000D_
_x000D_
/* This bit draws the box around it */_x000D_
border:1px solid grey;_x000D_
_x000D_
/* I've used padding so you can see the edges of the elements. */_x000D_
padding:2px;_x000D_
}_x000D_
_x000D_
input {_x000D_
/* Tell the input to use all the available space */_x000D_
flex-grow:2;_x000D_
/* And hide the input's outline, so the form looks like the outline */_x000D_
border:none;_x000D_
}_x000D_
_x000D_
input:focus {_x000D_
/* removing the input focus blue box. Put this on the form if you like. */_x000D_
outline: none;_x000D_
}_x000D_
_x000D_
button {_x000D_
/* Just a little styling to make it pretty */_x000D_
border:1px solid blue;_x000D_
background:blue;_x000D_
color:white;_x000D_
}
_x000D_
<form>_x000D_
<input />_x000D_
<button>Go</button>_x000D_
</form>
_x000D_
There's limited Flexbox support in IE9, so the button will not be on the right of the form. IE9 has not been supported by Microsoft for some years now, so I'm personally quite comfortable with this.
I've used minimal styling here. I've left in the padding to show the edges of things. You can obviously make this look however you want it to look with rounded corners, drop shadows, etc..