Skip to content

Glossary: HTML & CSS Basics

Padding, border and margin

Also written: padding, margin, border

The three box model layers around an element's content. Padding is space inside the border and takes the background color, the border is a line around it, and the margin is transparent space outside pushing other elements away.

Where the book teaches it

Related terms

Box modelShorthandMargin collapsing