Spacing

Tailwind CSS p-0 Class

The p-0 utility class generates the following CSS when applied to an element.

CSS Output

CSS
.p-0 {
  padding: 0px;
}

Variants

Use these variant prefixes to apply p-0 conditionally:

responsive:p-0hover:p-0first:p-0last:p-0

Use It

HTML
<div class="p-0 bg-blue-100">No padding</div>

Understanding p-0

The Tailwind CSS p-0 utility applies padding: 0px; to an element when added to its class attribute. It removes all padding from the element. Useful for resetting default browser padding on elements like ul, ol, or body.

This utility is part of Tailwind's Spacing module, designed for managing margins and padding to establish consistent whitespace and visual rhythm. In Tailwind's utility-first workflow, you add p-0 directly to your HTML elements rather than writing custom CSS. This approach accelerates development and keeps styles co-located with your markup, making it easy to see exactly how each element is styled at a glance.

Common responsive variants include sm:p-0, md:p-0, lg:p-0, and xl:p-0, allowing different behavior at each breakpoint. State variants like hover:p-0 and focus:p-0 enable interactive styling without any JavaScript. You can also combine multiple variants for fine-grained control over when the utility applies.

This class works well alongside `p-1`, `p-2`, `p-4`, `m-0` to build complete, production-ready interfaces. Tailwind's tree-shaking ensures only utilities you actually use appear in your final CSS bundle, keeping file sizes minimal. Browser support for the underlying CSS is excellent across Chrome, Firefox, Safari, and Edge.

Related Classes

Explore More Tailwind Classes

Browse our complete reference of 321 Tailwind CSS utility classes with CSS output, variants, and examples.