Skip to content

Padding

Padding is the internal space between the content and border of a CSS box. It separates text, images or controls from their surrounding edge

What it means, how it is used and where it comes up, with its related concepts.

What it is and how it works

Its effect on total size depends on the box model: with border-box, it is included within the declared width. It differs from margin, which sits outside the border. The appropriate amount depends on the content and interaction; generous spacing does not in itself guarantee an accessible activation area.

Related concepts

Padding: what it is and how it works · Zorraquino