CSS: Box-Sizing property

What is box-sizing property?

Ever wondered why different HTML elements with same width or height take up different space on the page based on border or padding? Or maybe you see box-sizing property in other people's CSS and wonder what it does?

Well here is a basic intro to the property.

The box-sizing property defines the size of the element based of width/height, padding & border width of that element. Most commonly used value for the property is "border-box" which allows us to include the padding and border in an element's total width and height.