Thanks to visit codestin.com
Credit goes to www.cssportal.com

CSS Portal

CSS padding-inline-end Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The padding-inline-end property controls the padding placed on the "end" side of an element along its inline axis. Because it is a logical property, it expresses padding in terms of the flow of text rather than a fixed physical side such as left or right. The padding this property sets becomes part of the element’s box: it increases the space between the element’s content and its border on the inline end side and is included in painting (background, clip) and hit-testing behavior.

This logical behavior means the effect of padding-inline-end depends on the element’s writing direction and orientation. For horizontal left-to-right text the inline end maps to the physical right side, while for right-to-left text it maps to the physical left; in vertical writing modes the inline axis runs top-to-bottom (or bottom-to-top), so the property can correspond to a top or bottom physical edge. How the inline axis is defined is influenced by the element’s writing-mode and the inline progression direction is affected by the direction property.

When you use logical padding properties together they interact predictably: padding-inline is the shorthand that can set both inline start and inline end at once, and the complementary longhand padding-inline-start addresses the opposite inline side. In layout calculations, whether padding contributes to an element’s outer size depends on the element’s box-sizing model; percentage paddings are resolved relative to the containing block’s inline size rather than its block size.

Using logical properties like padding-inline-end simplifies localization and responsive design because you don’t need to switch physical left/right values when the text direction or writing mode changes. It also pairs naturally with logical margins such as margin-inline-end when you want consistent spacing behavior across different directions. Overall, padding-inline-end gives you a direction-agnostic way to control inline-side spacing while keeping layout behavior consistent as writing modes or directions vary.

Definition

Initial value
0
Applies to
all elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
Inherited
no
Computed value
as <length>
Animatable
a length
JavaScript syntax
object.style.paddingInlineEnd

Interactive Demo

The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass.

Syntax

padding-inline-end: <padding-top> 

Values

  • <padding-top> Specifies distance in px, pt, cm, etc. Negative values are not allowed.

Example

<div class="example">
<p class="note">The red line indicates the padding-inline-end edge (60px).</p>
<div class="box" dir="ltr">
<p><strong>LTR:</strong> This box has padding-inline-end set to 60px.</p>
</div>
<div class="box" dir="rtl">
<p><strong>RTL:</strong> This box has padding-inline-end set to 60px.</p>
</div>
</div>
.example {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  max-width: 640px;
  margin: 24px;
}

.note {
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
}

.box {
  position: relative;
  border: 2px solid #4b5563;
  background: #f3f4f6;
  padding: 12px;
  padding-inline-end: 60px;
  box-sizing: border-box;
}

.box::after {
  /* marker aligned to the padding-inline-end edge */
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #ef4444;
  inset-inline-end: 60px;
  pointer-events: none;
}

.box p {
  margin: 0;
  background: rgba(255,255,255,0.6);
  display: inline-block;
  padding: 6px 8px;
}

.box[dir='rtl'] p {
  /* ensure the inline content direction is visible */
  text-align: right;
}

Browser Support

The following information will show you the current browser support for the CSS padding-inline-end property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!