CKTIS / CSS
padding-inline — logical inline padding
padding-inline sets the inner spacing at the start and end of the inline axis. It lets spacing follow the writing direction and writing mode instead of hard-coding the left and right sides.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
padding-inline: <'padding-top'>{1,2};padding-inline is a shorthand for padding-inline-start and padding-inline-end. One value applies to both ends; two values specify inline start and inline end, respectively. It does not set block-axis padding.
With writing-mode: horizontal-tb and direction: ltr, start means left and end means right. With direction: rtl, those sides swap. In vertical writing modes, the inline axis is vertical; mapping depends on writing-mode, direction, and text-orientation.
Padding is space between content and border, not an outer margin. Nonnegative lengths and percentages are allowed, but auto is not. Percentages refer to the containing block’s inline size, not the element’s own size. Both longhands initially have value 0 and are not inherited.
The example compares the same declaration in LTR and RTL. The preceding padding: 0 resets all sides so the example isolates padding-inline. Running the example in a browser confirmed the output shown.
Examples
<!doctype html>
<meta charset="utf-8">
<style>
.box {
writing-mode: horizontal-tb;
padding: 0;
padding-inline: 12px 24px;
border: 1px solid;
}
</style>
<div class="box" dir="ltr">LTR</div>
<div class="box" dir="rtl">RTL</div>
<pre id="result"></pre>
<script>
const lines = [...document.querySelectorAll('.box')].map(box => {
const style = getComputedStyle(box);
return `${box.textContent}: left=${style.paddingLeft}, right=${style.paddingRight}`;
});
document.getElementById('result').textContent = lines.join('\n');
</script>Result
LTR: left=12px, right=24px RTL: left=24px, right=12px
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.