Probably newlines between <input>
tags are interpreted as any other whitespaces, that's why you see spaces between them. I think CSS rules has nothing to do with it.
Edit: Further investigation leads me to conclusion that whitespaces would only affect horizontal gaps. As of vertical space I believe it is impossible to assure that checkboxes will stick together without using custom graphics — web browsers are not obligated to make them perfectly square by standards, so even if you will find a way to make their bounding boxes touch each other, effect might not be satisfactory.
To make their bounding boxes as close as possible set line-height
attribute for div
element. With original sprites it doesn't look like you wanted it to in any browser I have tested.
Using custom graphic of some height, and identical line-height
should do the trick.
Another edit: Some people here proposed using fixed height of input element of 13px
. Remember! It is wrong. You can't rely on a fact, that some browsers have built-in checkbox sprite of that height.