Elements that have a set width become wider when they have padding and/or border-width. To avoid these problems, make use of the now common box-sizing: border-box; reset.
P. Pudil, F. Ferri, J. Novovicova, and J. Kittler. In Proceedings of the Twelveth International Conference on Pattern Recognition, IAPR, page 279--283. (1994)