Check out example codes for "stop padding from changing div size". It will help you in understanding the concepts better.

Code Example 1

-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box;    /* Firefox, other Gecko */
box-sizing: border-box;         /* Opera/IE 8+ */

Learn ReactJs, React Native from akashmittal.com