Question 2: what is a box model?

Time:2022-3-16

concept

  • All HTML tags can be understood as a box model
  • The box model is mainly composed of four parts: content, padding, border and margin

    <img></img>

Standard box model (W3C box model) content box

  • Box size = content

Weird box model (ie box model) border box

  • Box size = content + padding + border

The content / inspiration of the article is drawn from the following content