For this a simple solution, just add this to your CSS declaration:
box-sizing: border-box;
The reason for the horizontal scrollbar to appear is because the add and border are added by default to whatever width you give the element. By setting it explicitly to the border-box , the append and border are included in this width value.
This property is supported in IE8 +, FireFox 19+ (using -moz-box-sizing ) and iOS Safari and Android (using -webkit-box-sizing )
In addition, I highly recommend using css shorthand as follows:
.test { BOX-SIZING: border-box; WIDTH: 100%; HEIGHT: 100%; PADDING: 10px 0 10px 10px; BORDER: #7F9DB9 1px solid; BACKGROUND-COLOR: #ffffff; }
source share