CSS Box Model

CSS renders HTML elements as boxes with content area and optional padding, borders and margins. All these properties can be set to be different on the different sides of the box. The CSS properties for width and height only specify the width and height of the content area.

CSS box model diagram