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.
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.
Hi there! It’s unclear what is the “first place” did you mention, where is it?
The thing is that by default, when you set a width or height for an element in CSS, you are using the ‘content-box’ model.
And according to CSS specs box-sizing property has two values: content-box and border-box, and the note tells this about content-box:
This is the behavior of width and height as specified by CSS2.1, and is thus the default.
So, it’s the initial value set during CSS development, such as many others of another CSS properties.