On this page
  1. padding
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

padding

Prev: `margin` | Up: box_model | Next: `aspect-ratio`
Rel: box_model, Box Model & Sizing Guide
Ref: MDN Web Docs — padding
Tags: #public #web #css #properties #box_model #tier/core


Syntax & Overview

padding: 1rem 1.5rem;  /* logical: padding-inline, padding-block */

Inner spacing between content and border (never collapses, never negative).

Notes & Best Practices

Example

.btn {
  padding-block: 0.5rem;
  padding-inline: 1rem;
}

Linked from

Related notes