CSS Padding

Introduction to Padding

Padding adds space inside an element, between the content and its border.

Padding Properties

  • padding: sets all four paddings.
  • padding-left, padding-right, etc.

Examples

div { padding: 20px; background: #eee; }

p { padding-top: 10px; padding-bottom: 10px; }