The newlines between the <input> tags are probably interpreted as any other spaces, so you see spaces between them. I think the CSS rules have nothing to do with this.
Edit: Further research leads me to conclude that spaces will only affect horizontal gaps. Regarding the vertical space, I believe that it is impossible to guarantee that the flags will stick together without using custom graphics - web browsers are not required to make them perfectly square by standards, so even if you find a way to make their bounding boxes touch each other, the effect may be unsatisfactory.
To make your bounding rectangles as close as possible, set the line-height attribute on the div element. With the original sprites, it doesn't look the way you wanted it in any browser that I tested.
Using custom graphics of some height and identical line-height should do the trick.
Other editing: Some people suggested using a fixed input element height of 13px . Remember! This is not true . You cannot rely on the fact that some browsers have a built-in help flag of this height.
source share