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.
a micro, modular, Object-Oriented and concise JavaScript Library that simplifies HTML document traversing, event handling, and Ajax interactions for rapid mobile web development. It allows you to write powerful, flexible and cross-browser code with its elegant, well documented and micro coherent API.
D. Johnson, and T. Jankun-Kelly. Proceedings of graphics interface 2008, page 163--168. Toronto, Ont., Canada, Canada, Canadian Information Processing Society, (2008)