The problem you have here is with inline-block .
display:inline-block tells the browser to treat the element as a block in relation to its contents, but as an inline element in relation to its environment.
The problem for you here is that the surrounding around the two elements contain some empty space. In particular, you have a space between the two elements. White space matters for inline elements as well as inline-block elements.
In a nutshell, it's as if the two elements were words in a sentence. The space between them is considered as the space between two words.
As a result, you will get 50% width + width of one space character + 50% width .
This is a well known issue with inline-block , but travels a lot.
A quick + dirty solution, therefore, should remove the space - close the gap between the end of the <select> and the beginning of the <input> so that there is no space.
Other alternatives include using comments to fill in the gap (ugly), styling the container element with font-size:0px; and various other hacker solutions.
Alternatively, you can discard the built-in blocks. There are a number of other options that can achieve the same or similar results - in particular, float , display:table-cell and flex-box , but there are others.
But my suggestion is only to remove the spaces between these two elements. Quick and easy fix.
source share