0

CSS padding playground

Explore padding with interactive controls for all sides, per-side, or per-axis spacing, switch units, and compare physical and logical properties.

Ask AI

CSS padding playground

Response generated with openai/gpt-5.4-nano. AI can make mistakes. Always review the result.
padding
HTML
<div class="padding" dir="ltr">
  <div>padding</div>
</div>
Tailwind CSS
Some classes with arbitrary values can be replaced by native classes, depending on the value and your Tailwind CSS configuration.
<div class="inline-[min(100%,28rem)] min-block-80 border border-blue-400 rounded-xl bg-gray-100 p-[24px]" dir="ltr">
  <div class="inline-max min-block-20 p-4 border border-dashed border-amber-500 rounded-lg bg-white">padding</div>
</div>
CSS
.padding {
  inline-size: min(100%, 28rem);
  min-block-size: 20rem;
  border: 1px solid #60a5fa;
  border-radius: 0.75rem;
  background-color: #f3f4f6;
  padding: 24px;
}

.padding > div {
  inline-size: max-content;
  min-block-size: 5rem;
  padding: 1rem;
  border: 1px dashed #f59e0b;
  border-radius: 0.5rem;
  background-color: #ffffff;
}