Having a border on which you did not have one (or increasing border-width ) will actually make the element larger, therefore it can potentially lead to the movement of other elements. To avoid this, you must make sure that the total size (height or width + padding + border + margin) is the same. In your case, I think you should try adding 2px margin to the unfocused style to compensate (since the border of the focused element is 2px larger). Try:
input[type="text"], input[type="password"] { border: 1px solid #CCCCCC; box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.2); min-height: 22px; padding: 3px; margin: 2px; } .checkout input:focus { border:3px solid #6b991c; padding:2px; margin: 0; }
source share