You do not actually need to have the submit button inside of the input, you merely need to make it appear so..
What you need to do is position the two elements right up beside each other, and then style them in a manner that will make them appear together.
To get elements beside each other you can use various css techniques such as display: inline-block;
, which places elements inline (beside each other, on the same 'line') while maintaining the properties of a block element. Or, if you want to wrap a container around the elements, you can use float
to position the elements, or display: table-cell;
inside of a display: table;
container. (There are more ways than this too, if you want to look into it some more!)
As for the styling, in your example image in particular, this effect can be achieved by using border radius only on the outer corners of each element, leaving the inner ones square and flush with each other, and then borders around the outer edges to make them appear as one. Again, if you have a container element, you can style it to create the effects on the outer edges, and then individually style the input and button as well.