The Box Model:

Another technique for changing the size of individual boxes, as well as controlling the relationships of elements to each other, is with the margin & padding CSS properties.

In HTML and CSS, we imagine elements as boxes with certain properties. Specifically, every block element in HTML has padding, a border, and margin. This is known as the “Box Model”.

The Box Model
Margin
Border
Padding
The Content!

The following pages will help breakdown these areas.

{ TODO: }

The above “Box Model” image comes from web specifications. Please read both of the following;

  1. Introduction to the CSS Box Model,” from Mozilla Developer Network
  2. The Box Model,” from W3Schools
  3. Read pages 307-308 of Chapter 13 in Duckett.

Previous section:
Next section: