CSS padding-block Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The padding-block property is a shorthand for padding-block-start and padding-block-end. It sets inner spacing on the block axis.

In a horizontal writing mode (the usual default), that maps to top and bottom — like padding-top / padding-bottom. With a vertical writing-mode, it can map to the physical left/right sides instead. It is not inherited. Each side starts at 0. Negative values are invalid.

Baseline · Widely available.

Not deprecated. Cross-browser since about April 2021. Prefer it over physical top/bottom when writing mode may change.

Logical tip.

Pair with padding-inline for the other axis. Together they replace the classic four physical paddings in writing-mode-aware layouts.

CSS Syntax

syntax.css
padding-block: [ <length> | <percentage> ]{1,2} | initial | inherit;

1 value = both block-start and block-end. 2 values = block-start, then block-end.

Property Values

ValueDescriptionTry it
One lengthSame padding on block-start and block-end, such as 1remTry it
Two valuesStart then end, such as 0.5rem 1.5remTry it
<percentage>Percent of the containing block’s inline size (usually its width)Try it
With writing-modeShows how block padding maps when text flows verticallyTry it
Mixed unitsDifferent units on start and end, such as 8px 1.5remTry it
initialResets both sides to 0Try it
inheritInherits from the parent elementTry it

How to Use padding-block

Think in block-start / block-end instead of top / bottom.

  1. Decide the block-axis inner spacing (before and after the content in the writing flow).
  2. Set padding-block with one value (both sides) or two (start, end).
  3. Use padding-inline if you also need the inline axis.
  4. Test with writing-mode if the page may switch orientation.
In horizontal-tbUsually maps to
padding-block-startpadding-top
padding-block-endpadding-bottom
padding-block: 1remLike padding-top and padding-bottom: 1rem

Live Preview

The amber area is padding. Change padding-block in a horizontal writing mode (block-start = top, block-end = bottom).

Amber = block-axis padding. White dashed = content. Inline sides stay at 0 here.

Box
Content

padding-block: 0

CSS Examples

Each snippet shows only padding-block (plus writing-mode when needed). Use Try It Yourself for a live editor.

Example 1 — Same Value Both Sides

One value sets block-start and block-end together.

CSS
<style>
  .box {
    padding-block: 1rem;
    border: 1px solid #ccc;
  }
</style>

<div class="box">Padded content</div>
Try It Yourself

How It Works

  1. One length. 1rem applies to both block-start and block-end.
  2. Horizontal default. That usually means top and bottom get 1rem.
  3. Inline stays untouched. Left and right padding are not set by this shorthand.
  4. Same as two equal longhands. Equivalent to setting start and end both to 1rem.

Example 2 — Different Start and End

Two values set block-start, then block-end.

CSS
<style>
  .box {
    padding-block: 0.5rem 1.5rem;
    border: 1px solid #ccc;
  }
</style>

<div class="box">Card text</div>
Try It Yourself

How It Works

  1. First value. 0.5rem is block-start (usually top).
  2. Second value. 1.5rem is block-end (usually bottom).
  3. Asymmetric spacing. More padding appears after the content than before it.
  4. Longhand option. Same as padding-block-start / padding-block-end separately.

Example 3 — Vertical Writing Mode

Block padding follows the writing mode, not always top/bottom.

CSS
<style>
  .box {
    writing-mode: vertical-rl;
    padding-block: 1rem;
    border: 1px solid #ccc;
  }
</style>

<div class="box">Vertical text</div>
Try It Yourself

How It Works

  1. Change the flow. writing-mode: vertical-rl makes lines run top to bottom.
  2. Block axis flips. Block-start/end are no longer physical top/bottom.
  3. Padding stays logical. padding-block: 1rem still means before and after on the block axis.
  4. Why it matters. The same rule stays correct if the page switches writing mode later.

Edge Cases & Pitfalls

If the wrong sides get padding, writing mode or physical longhands are usually why.

physical

Not the same as top/bottom forever

In horizontal writing it usually matches top/bottom. In vertical writing it can match left/right. Prefer physical longhands only when you mean a fixed screen edge.

negative

Negative padding is invalid

Like all padding properties, negative lengths are not allowed. The declaration is ignored.

percent

Percentages use the containing block width

Percentage padding resolves against the containing block’s inline size (usually width), even for block-axis sides.

shorthand

It does not set the inline axis

padding-block never sets left/right in horizontal mode. Use padding-inline or the full padding shorthand for those sides.

override

Later physical padding can override

A following padding-top still wins for that physical side. Keep logical and physical rules from fighting each other.

Browser Support

padding-block is a browser CSS property for logical box spacing. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

padding-block

Chrome 87+, Firefox 66+, Safari 14.1+, Edge 87+. Widely available since April 2021. Not in Internet Explorer.

97% Logical padding support
Google Chrome 87+
Full support
Mozilla Firefox 66+
Full support
Apple Safari 14.1+
Full support
Microsoft Edge 87+
Full support
Opera 73+
Full support
Samsung Internet 14+
Full support
Internet Explorer Not supported
Not supported
padding-block Widely supported

Bottom line: Safe for modern sites. For Internet Explorer, fall back to physical padding-top / padding-bottom. It is not a runtime API.

Key Takeaways

  • Role: logical inner spacing on the block axis (start and end).
  • Shorthand: 1 value = both sides; 2 values = start, then end.
  • Maps by writing mode: usually top/bottom in English; can be left/right in vertical text.
  • Pair with: padding-inline for the other axis; no auto, no negatives.

One line: padding-block sets block-axis padding that follows writing mode — use 1 or 2 non-negative values.

Frequently Asked Questions

It is a shorthand for padding-block-start and padding-block-end. It sets inner spacing on the block axis, which maps to physical sides based on writing mode.
Each longhand defaults to 0, so there is no block-axis padding until you set one.
padding-top and padding-bottom always mean physical top and bottom. padding-block follows the writing mode, so in horizontal text it is usually top/bottom, and in vertical text it can map to left/right.
Yes. One value sets both start and end. Two values set start, then end. Negative values are invalid.
Use it when block-axis inner spacing should stay correct if writing-mode or direction changes, especially in multilingual layouts.
It is Baseline and widely available in modern browsers since about April 2021 (Chrome 87+, Firefox 66+, Safari 14.1+). It is a browser CSS property, not a Node.js feature.

Next: padding-block-end

Learn the longhand for block-end padding alone.

padding-block-end tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful