CKTIS / CSS
padding-inline-end — padding at the inline end
padding-inline-end sets internal spacing at the end of the inline axis. Unlike padding-right, it selects a side according to the element’s writing mode and direction.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
padding-inline-end: <length-percentage [0,∞]>;padding-inline-end sets padding between the content and border on the end side of the inline axis. It is not a margin outside the border. Its mapping to a physical side depends on the element’s writing-mode, direction, and text-orientation.
With writing-mode: horizontal-tb and direction: ltr, it corresponds to padding-right; with direction: rtl, it corresponds to padding-left. In vertical writing modes it can correspond to the top or bottom side, so do not treat it as a fixed replacement for padding-right.
It accepts a nonnegative length or percentage; auto and negative values are invalid. Percentages refer to the containing block’s logical width, not the size of the side being padded. The initial value is 0, and the property is not inherited. The padding-inline shorthand sets both ends of the inline axis.
The example resets the other padding and sets 24px only at the inline end. The two elements differ in writing direction; the expected messages show the padded side switching from right to left.
Examples
<!doctype html>
<meta charset="utf-8">
<title>padding-inline-end</title>
<style>
.box {
writing-mode: horizontal-tb;
padding: 0;
padding-inline-end: 24px;
border: 1px solid;
margin: 8px;
}
</style>
<div class="box" dir="ltr">LTR</div>
<div class="box" dir="rtl">RTL</div>
<script>
for (const box of document.querySelectorAll('.box')) {
const style = getComputedStyle(box);
console.log(`${box.dir}: left=${style.paddingLeft}, right=${style.paddingRight}`);
}
</script>Result
ltr: left=0px, right=24px rtl: left=24px, right=0px
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.