CSS padding Property Explained

What the CSS padding property does, with an example.

Published November 4, 2026

The CSS padding property sets the space inside an element's border, between the border and its content.

Key points

  • Check browser compatibility on a resource like caniuse.com if targeting older browsers

Example

padding: 8px 16px;
More CSS articles