another solution set -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; to the input