Browse documentation

Reference / Spacing

Padding

Add space between an element’s content and its border. Use one value for every edge or tune the inline and block axes separately.

Working example

The ps and pe prefixes follow the inline reading direction. Use them for an indented label that also needs to work in right-to-left text.

HTML
<div class="inline-flex items-center border bg-neutral-100 px-4 py-2">
  <span class="font-semibold">Binding sample</span>
</div>

Class reference

ClassCSS declarations
p-0padding: 0px;
p-4padding: 1rem;
px-6padding-inline: 1.5rem;
py-2padding-block: 0.5rem;
pt-3padding-top: 0.75rem;
pr-2padding-right: 0.5rem;
pb-4padding-bottom: 1rem;
pl-2padding-left: 0.5rem;
ps-4padding-inline-start: 1rem;
pe-4padding-inline-end: 1rem;
p-[18px]padding: 18px;
View full generated CSS
Compiled CSS
.p-0 {
  padding: 0px;
}
.p-4 {
  padding: 1rem;
}
.p-\[18px\] {
  padding: 18px;
}
.px-6 {
  padding-inline: 1.5rem;
}
.py-2 {
  padding-block: 0.5rem;
}
.pb-4 {
  padding-bottom: 1rem;
}
.pe-4 {
  padding-inline-end: 1rem;
}
.pl-2 {
  padding-left: 0.5rem;
}
.pr-2 {
  padding-right: 0.5rem;
}
.ps-4 {
  padding-inline-start: 1rem;
}
.pt-3 {
  padding-top: 0.75rem;
}