Skip to content

Box Model

Box Model

The CSS Box Model is a conceptual model that describes how the margin, border, and padding properties are arranged relative to the content in an HTML element.

  • Margin describes spacing outside the element's box (the space between this element and others).
  • Padding describes spacing inside the element's box (the space between the content and the border).
  • Border sits between the padding and margin, forming a "frame" around the content.
CSS Box Model
CSS Box Model

See the Pen CSS Box Model (IMS322 Docs) by Eric Sheffield (@ersheff) on CodePen.