Check out example codes for "making border go inside". It will help you in understanding the concepts better.

Code Example 1

box-sizing: border-box;

Code Example 2

div {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    width: 100px;
    height: 100px;
    border: 20px solid #f00;
    background: #00f;
    margin: 10px;
}

div + div {
    border: 10px solid red;
}

Learn ReactJs, React Native from akashmittal.com