Box Model
Box Model ~10 mins

Box Model

content-box Width and height of the element only includes content area.
padding-box Width and height of the element includes content and padding.
border-box Width and height of the element includes content, padding and border.
initial Sets the box model to its default state.
inherit Inherits the box model of the parent element

What is Box Model ?

  div {
border: 5px solid red;
margin: 50px;
padding: 20px;
}

box-sizing

The default box model (content-box) can be counter-intuitive, since the width / height for an element will not
represent its actual width or height on screen as soon as you start adding padding and border styles to the element.

  textarea {
width: 100%;
padding: 3px;
box-sizing: content-box; /* default value */
}
 textarea {
width: 100%;
padding: 3px;
box-sizing: border-box;
}
 html {
box-sizing: border-box;
}

*, *:before, *:after {
box-sizing: inherit;
}