Content-Box to Border-Box

Hi,

Just a general question: If it’s best practice to change content-box to a border-box, why does content-box exists in the first place?

Thanks in advance.

It is common practice to always switch box-sizing to border-box. It makes life a little easier as you don’t have to do the calculations for how big an element will be when adding padding, border…etc.

Content-box existed before border-box was created. Making border-box the default would break all old layouts people created, so it is kept as the default.

2 Likes