CSS padding-inline-end Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Logical CSS & Box Model

What You’ll Learn

The padding-inline-end property sets inner spacing on the inline-end side of an element. In horizontal left-to-right writing, that is usually the right padding between content and the border.

01

Inline-End Only

One logical edge.

02

Syntax

Single value.

03

Units

px, em, rem, %.

04

RTL Support

Follows text direction.

05

Default 0

No spacing by default.

06

padding-inline

Inline-axis shorthand.

Introduction

The padding-inline-end property in CSS is used to define the padding at the end of an element’s inline direction.

This property is part of the logical properties in CSS, which allows for more flexible layouts that can adapt to different writing modes, such as left-to-right (LTR) or right-to-left (RTL) text directions.

Definition and Usage

Apply padding-inline-end when you need inner spacing on only the inline-end side and want that spacing to follow the inline axis instead of a fixed physical right edge. Use it for paragraphs, buttons with trailing icons, list items, and any component that needs extra room after the content along the inline direction.

Like regular padding, padding-inline-end increases the visible size of an element’s background and border box. It never collapses and always stays inside the element’s border.

💡
Beginner Tip

In LTR English, padding-inline-end: 20px; looks like right padding. In RTL, inline-end moves to the left side so spacing still follows the text flow.

LTR → inline-end is right RTL → inline-end is left

📝 Syntax

The syntax for the padding-inline-end property is simple. You can specify the padding using any valid CSS length value, including pixels, ems, percentages, and more.

syntax.css
element {
  padding-inline-end: value;
}

Here, value can be a length (e.g., 10px, 1em, 5%) or a keyword like auto or inherit.

Basic Example

padding-inline-end.css
p {
  padding-inline-end: 20px;
  background-color: lightgrey;
}

Syntax Rules

  • Apply padding-inline-end to any element that needs extra inner space on the inline-end side.
  • The value is a length, percentage, or keyword such as auto, initial, inherit, or unset.
  • The property is not inherited — child elements do not automatically get the parent’s inline-end padding.
  • Percentage padding is calculated relative to the inline size of the containing block.

⚡ Quick Reference

QuestionAnswer
Initial value0
Applies toInline-end padding side only
InheritedNo
AnimatableYes, as a length
Common useParagraphs, buttons, list items, and RTL-aware trailing spacing

🎯 Default Value

The default value of the padding-inline-end property is 0. This means that if no value is specified, there will be no padding applied at the end of the inline direction.

💎 Property Values

ValueExampleDescription
Lengthpadding-inline-end: 10px;Specifies a fixed padding, such as 10px, 1em, or 5%.
autopadding-inline-end: auto;The browser calculates the padding.
inheritpadding-inline-end: inherit;Inherits the padding value from the parent element.
initialpadding-inline-end: initial;Sets the property to its default value.
unsetpadding-inline-end: unset;Resets the property to its natural value.
padding-inline-end: 20px; padding-inline-end: 1.5rem; padding-inline-end: 5%;

👀 Live Preview

Four boxes with the same content and different pie- utility classes showing increasing inline-end inner spacing:

pie-sm
pie-md
pie-lg
pie-xl

Examples Gallery

Start with the reference paragraph example, try different inline-end values, add trailing spacing in components, and compare logical inline-end padding with physical right padding.

🔢 Basic padding-inline-end

Start with the reference example — inline-end padding on a paragraph with a light grey background.

Example 1 — Paragraph with Inline-End Padding

In this example, we’ll apply padding-inline-end to a paragraph element to add padding to the end of the inline direction.

padding-inline-end-example.html
<style>
  p {
    padding-inline-end: 20px;
    background-color: lightgrey;
  }
</style>

<p>
  This paragraph has padding at the inline end. In LTR, that is extra space on the right.
</p>
Try It Yourself

How It Works

The grey background fills the padding area, so the 20px gap appears between the content and the border on the inline-end side. In horizontal LTR, that is the right edge.

Example 2 — Different Inline-End Values

Use rem units for scalable inline-end spacing that grows with root font size.

padding-inline-end-rem.css
.compact {
  padding-inline-end: 0.5rem;
}

.comfortable {
  padding-inline-end: 1.5rem;
}

.spacious {
  padding-inline-end: 2.5rem;
}
Try It Yourself

How It Works

Each class sets a different inline-end padding while leaving inline-start unchanged. The background fills the padding area so you can compare the spacing visually.

🛠 Layout Patterns

Apply inline-end padding to components and compare logical vs physical properties.

Example 3 — Button with Trailing Icon Space

Add inline-end padding to a button so text does not crowd a trailing icon or arrow.

padding-inline-end-button.css
.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-inline-start: 1rem;
  padding-inline-end: 1.25rem;
  padding-block: 0.6rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
}
Try It Yourself

How It Works

Extra padding-inline-end gives the trailing arrow more room. In RTL layouts, inline-end padding stays on the trailing side of the text.

Example 4 — Logical vs Physical Inline-End

Compare padding-inline-end with padding-right.

padding-inline-end-logical.css
/* Logical — follows text direction */
.logical {
  padding-inline-end: 24px;
}

/* Physical — fixed to right edge */
.physical {
  padding-right: 24px;
}
Try It Yourself

How It Works

In horizontal LTR English, both approaches look the same. padding-inline-end stays correct when text direction changes to RTL; physical right padding does not.

padding-inline-end vs padding-inline, padding-right & inline-start

The padding-inline shorthand sets both inline-start and inline-end padding in one declaration. Use padding-inline-end when you need spacing on only the inline-end side.

padding-right always targets the physical right edge. Pair padding-inline-end with padding-inline-start for full per-edge inline-axis control, or use padding for physical four-side shorthand.

padding-inline-end-companion.css
/* Inline-end only */
.label {
  padding-inline-end: 1rem;
}

/* Both inline sides via shorthand */
.card {
  padding-inline: 1.25rem 0.75rem;
}

/* Physical fallback for older browsers */
.legacy-label {
  padding-right: 1rem;
}

♿ Accessibility

  • Improve readability — Text benefits from inline-end padding so content does not crowd the trailing border edge.
  • Respect text direction — Logical inline-end padding keeps spacing correct for RTL and multilingual users.
  • Size touch targets — Buttons with trailing icons need comfortable inline-end padding for easy tapping.
  • Do not hide content — Very large inline-end padding on small screens can squeeze readable text area.
  • Test zoomed layouts — Users who zoom in rely on comfortable padding to keep text readable.

🧠 How padding-inline-end Works

1

The browser finds inline-end

Text direction decides which physical edge is inline-end. In LTR, that is the right edge; in RTL, it is the left edge.

Text direction
2

You set a padding value

Write padding-inline-end: 20px; with a length, percentage, or keyword.

CSS rule
3

Browser adds space on inline-end

Padding is inserted between the content edge and the border on the inline-end side only.

Box model
=

Targeted inline-end spacing

Content has breathing room after it along the inline axis without affecting inline-start.

Browser Compatibility

The padding-inline-end property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.

Baseline · Modern browsers

Logical inline-end padding in today’s browsers

Chrome, Firefox, Safari, Edge, and Opera support padding-inline-end in current versions.

96% Modern browser support
Google Chrome 69+ · Desktop & Mobile
Full support
Mozilla Firefox 41+ · Desktop & Mobile
Full support
Apple Safari 12.1+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 56+ · Modern versions
Full support
padding-inline-end property 96% supported

Bottom line: Safe to use in modern projects. For older browsers, pair with padding-right as a fallback in LTR layouts.

Conclusion

The padding-inline-end property is a useful tool for web developers looking to create flexible and adaptable layouts.

By using logical properties like padding-inline-end, you can ensure that your designs work well in different writing modes and text directions. Experiment with different values and see how this property can enhance the layout and readability of your web projects.

💡 Best Practices

✅ Do

  • Use padding-inline-end for trailing spacing along the inline axis
  • Prefer rem or em for scalable inline-end spacing
  • Pair with padding-inline-start for per-edge inline control
  • Use logical properties in multilingual or RTL layouts
  • Provide padding-right fallback for legacy LTR browser support

❌ Don’t

  • Assume inline-end is always the right side in every layout
  • Confuse inline-end with block-end (bottom in horizontal writing)
  • Use excessive inline-end padding that breaks mobile layouts
  • Forget that percentage padding is based on inline size
  • Replace margin with padding-inline-end for outer spacing between elements

Key Takeaways

Knowledge Unlocked

Five things to remember about padding-inline-end

Use these points when spacing content on the inline-end side.

5
Core concepts
0 02

Default 0

No spacing.

Default
RTL 03

Text Direction

Right in LTR.

Axis
% 04

Units

px, em, rem, %.

Values
pr 05

Not padding-right

Logical vs physical.

Companion

❓ Frequently Asked Questions

The padding-inline-end property sets inner spacing on the inline-end side of an element. In horizontal left-to-right writing, that is usually the right padding between the content and the border.
The default value is 0, meaning no inline-end inner spacing is applied unless you set padding-inline-end explicitly.
padding-right always targets the physical right edge. padding-inline-end follows the inline axis, so it stays correct when text direction changes to RTL.
Yes. In LTR, inline-end is the right side. In RTL, inline-end becomes the left side because it follows the text flow, not a fixed physical edge.
Use padding-inline-end when you need spacing on only the inline-end side and want that spacing to follow logical CSS. It pairs well with padding-inline-start and the padding-inline shorthand.

Practice in the Live Editor

Open the HTML editor, try different padding-inline-end values, and see how inline-end spacing changes your layout instantly.

HTML Editor →

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.

5 people found this page helpful