CSS padding-inline Property

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

Definition and Usage

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

In a horizontal left-to-right writing mode, that maps to left and right — like padding-left / padding-right. With direction: rtl, start and end swap sides. With a vertical writing-mode, it can map to top/bottom 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 left/right when direction or writing mode may change.

Logical tip.

Pair with padding-block for the other axis. Together they replace classic four-side padding in multilingual layouts.

CSS Syntax

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

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

Property Values

ValueDescriptionTry it
One lengthSame padding on inline-start and inline-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 direction: rtlShows how start/end flip for right-to-left textTry 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-inline

Think in inline-start / inline-end instead of left / right.

  1. Decide the inline-axis inner spacing (before and after the content along the line).
  2. Set padding-inline with one value (both sides) or two (start, end).
  3. Use padding-block if you also need the block axis.
  4. Test with direction or writing-mode if the page may switch.
In horizontal-tb + LTRUsually maps to
padding-inline-startpadding-left
padding-inline-endpadding-right
padding-inline: 1remLike left and right 1rem

Live Preview

The amber area is padding. Change padding-inline in a horizontal LTR writing mode (start = left, end = right).

Amber = inline-axis padding. White dashed = content. Block sides stay at 0 here.

Box
Content

padding-inline: 0

CSS Examples

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

Example 1 — Same Value Both Sides

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

CSS
<style>
  .box {
    padding-inline: 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 inline-start and inline-end.
  2. LTR default. That usually means left and right get 1rem.
  3. Block stays untouched. Top and bottom 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 inline-start, then inline-end.

CSS
<style>
  .box {
    padding-inline: 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 inline-start (usually left in LTR).
  2. Second value. 1.5rem is inline-end (usually right in LTR).
  3. Asymmetric spacing. More padding appears after the content than before it.
  4. Longhand option. Same as padding-inline-start / padding-inline-end separately.

Example 3 — RTL Direction

Inline padding flips with direction — start stays “before” the text.

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

<div class="box">نص عربي</div>
Try It Yourself

How It Works

  1. Flip direction. direction: rtl makes text flow right to left.
  2. Start moves. Inline-start is now the physical right; end is the left.
  3. Values stay logical. 0.5rem 1.5rem still means start, then end.
  4. Why it matters. The same rule works for LTR and RTL without rewriting left/right.

Edge Cases & Pitfalls

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

physical

Not the same as left/right forever

In horizontal LTR it usually matches left/right. In RTL those sides swap. In vertical writing it can match top/bottom. Prefer physical longhands only for a fixed screen edge.

rtl

RTL flips the inline axis

Unlike block-end, inline-start/end do change with direction. That is the main reason to prefer padding-inline for multilingual UI.

negative

Negative padding is invalid

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

shorthand

It does not set the block axis

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

override

Later physical padding can override

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

Browser Support

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

✓ Baseline · Widely available

padding-inline

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-inline Widely supported

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

Key Takeaways

  • Role: logical inner spacing on the inline axis (start and end).
  • Shorthand: 1 value = both sides; 2 values = start, then end.
  • Maps by direction: usually left/right in LTR; sides swap in RTL.
  • Pair with: padding-block for the other axis; no auto, no negatives.

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

Frequently Asked Questions

It is a shorthand for padding-inline-start and padding-inline-end. It sets inner spacing on the inline axis, which maps to physical sides based on writing mode and direction.
Each longhand defaults to 0, so there is no inline-axis padding until you set one.
padding-left and padding-right always mean physical left and right. padding-inline follows direction and writing mode, so in RTL it swaps sides, and in vertical text it can map to top/bottom.
Yes. One value sets both start and end. Two values set start, then end. Negative values are invalid.
Use it when horizontal (inline) inner spacing should stay correct for LTR and RTL, or when writing mode may change.
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-inline-end

Learn the longhand for inline-end padding alone.

padding-inline-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