box-sizing



examples/css/box_sizing.html
<style>
* {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}
div {
    height: 200px;
    border: solid;
    background-color: #5D5FD4;

}
#small {
    padding: 2px;
    margin: 20px auto;
    width: 600px;
}
#big {
    padding: 20px;
    margin: 50px auto;
    width: 600px;
}
</style>

<div id="small">
</div>

<div id="big">
</div>