Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

padding-inline-start — padding at the inline-start edge

padding-inline-start sets the inner spacing at the start of the inline axis. In horizontal writing, it maps to the left side for ltr and the right side for rtl, allowing spacing to follow the text direction.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

padding-inline-start: <length-percentage [0,∞]>;
/* Also accepts CSS-wide keywords. */

padding-inline-start sets the padding between content and border at the inline-start edge. It is a logical property, not a fixed equivalent of padding-left: its mapping depends on writing-mode, direction, and text-orientation. With horizontal-tb, it maps to the left for ltr and the right for rtl; in vertical writing, it can map to the top or bottom.

It accepts a nonnegative length or percentage; negative values and auto are invalid. Percentages refer to the containing block’s logical width, not the element’s own size. The initial value is 0, and the property is not inherited.

padding-inline-start changes one side, whereas the padding-inline shorthand sets both inline-start and inline-end. Physical and logical declarations control the same padding, so conflicts are resolved by the cascade. In the example, padding: 0 deliberately precedes the logical declaration.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>padding-inline-start</title>
<style>
  .box {
    writing-mode: horizontal-tb;
    padding: 0;
    padding-inline-start: 24px;
    border: 1px solid;
    margin-block: 8px;
  }
</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.dir}: left=${style.paddingLeft}, right=${style.paddingRight}`;
  });
  document.querySelector('#result').textContent = lines.join('\n');
</script>
</html>

Result

ltr: left=24px, right=0px
rtl: left=0px, right=24px

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources