box-sizing Explained
The box-sizing property controls whether width and height apply to the content box alone or to the entire visible box including padding and border.
content-box (default)
Width and height size only the content area. Padding and border are added on top. A 200 px element with 20 px padding becomes 240 px wide — surprising for most developers.
border-box
Width and height size the element including padding and border. The content area shrinks to absorb them. This matches how most designers think about element sizing.
Universal Reset
The modern best practice is to set box-sizing: border-box globally using the inherit trick so component libraries can override it safely.