Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Some issues about relation between width/height and margin/padding/border Reply To: Some issues about relation between width/height and margin/padding/border

#193147
Senff
Participant

A border and padding are existential parts of the element itself. Which is why they are part of box-sizing:border-box.

The margin however, is specifically defined as “space NEXT to an element where it’s a ‘no-go’ area“. Not in those exact words (duh) but it defines the margin as something that’s not part of the element itself, which is why it’s not part of box-sizing:border-box.

(Pretty deep!)