1. Home
  2. Css
  3. Box sizing - border box

Using border-box style on your element will include border and padding within the width and height.

        box-sizing: border-box;

        padding: 20px;
        border: 5px solid #4dc3a4;
        width: 100px;
        height: 100px;
        display: block;

<span class="element-styles">Without Border-box</span>
<span class="element-styles with-border-box">With Border-box</span>

Without Border-box With Border-box

Full Css cheatsheet