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
Binding sample
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.
<div class="inline-flex items-center border bg-neutral-100 px-4 py-2">
<span class="font-semibold">Binding sample</span>
</div>Class reference
| Class | CSS declarations |
|---|---|
p-0 | padding: 0px; |
p-4 | padding: 1rem; |
px-6 | padding-inline: 1.5rem; |
py-2 | padding-block: 0.5rem; |
pt-3 | padding-top: 0.75rem; |
pr-2 | padding-right: 0.5rem; |
pb-4 | padding-bottom: 1rem; |
pl-2 | padding-left: 0.5rem; |
ps-4 | padding-inline-start: 1rem; |
pe-4 | padding-inline-end: 1rem; |
p-[18px] | padding: 18px; |
View full generated 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;
}