An absolute position makes you dependent on the correct width of the input elements. This is difficult to do for a cross browser, as browsers typically use custom or custom elements that do not build sequentially. You are better off using an inline block or a floating layout that handles inconsistent widths.
If you really need to do this, there are some hacks that use the css3 box-sizing property and / or manually adjust properties, such as line size and font size and indentation, to make all browsers agree on the input size, but it's harder than that sounds.
This question has some information about box-sizing and using percent / auto widths to ensure consistency: input with mapping: a block is not a block, why not?
EDIT: based on your comment above, you may need to adjust some div wrappers to set the size / position of both the hidden and visible elements, and then use the percentage width and box-sizing as described.
<div class="input_wrapper" style="width:100px;position:relative"> <input style="width:100%;box-sizing:border-box;position:absolute"> <div class="fake_input" style="width:100%;position:absolute"> </div>
The key to this is that box-sizing:border-box less susceptible to browser differences in padding and border calculations when entering forms.
source share