Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

padding-block-end — padding at the block-end edge

padding-block-end sets the inner spacing at an element’s block-end edge. Unlike padding-bottom, it selects a physical side according to the writing mode rather than always targeting the bottom.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate; the usage example passed in isolated Chromium 157.0.8103.51, not tested in Chromium 152

Syntax

padding-block-end: <length-percentage [0,∞]>;

padding-block-end specifies spacing between content and border at the end of the block axis. With writing-mode: horizontal-tb, it corresponds to padding-bottom; with vertical-rl, to padding-left; and with vertical-lr, to padding-right. It therefore does not always mean the bottom edge.

It accepts a nonnegative length or percentage; negative values and auto are invalid. Its initial value is 0, and it is not inherited. Percentages refer to the containing block’s inline size, not the element’s own block size. CSS-wide keywords such as inherit and initial are also available.

This is a longhand: it changes only one edge. The padding-block shorthand sets both ends of the block axis. Logical and physical declarations control the same padding, so they do not add together; conflicts are resolved by the cascade. A later padding shorthand can override this spacing.

The example uses the same 24px value in two writing modes. The expected text shows bottom padding on the first element and left padding on the second. This example produced the expected text in an isolated run of Chromium 157.0.8103.51. It was not tested in Chromium 152.

Examples

<!doctype html>
<meta charset="utf-8">
<style>
  .box {
    padding: 0;
    padding-block-end: 24px;
    border: 1px solid;
    margin: 8px;
  }
  #horizontal { writing-mode: horizontal-tb; }
  #vertical { writing-mode: vertical-rl; }
</style>
<div id="horizontal" class="box">ABC</div>
<div id="vertical" class="box">ABC</div>
<pre id="result"></pre>
<script>
  const horizontal = getComputedStyle(document.getElementById('horizontal'));
  const vertical = getComputedStyle(document.getElementById('vertical'));
  document.getElementById('result').textContent =
    `horizontal: bottom=${horizontal.paddingBottom}, left=${horizontal.paddingLeft}\n` +
    `vertical: bottom=${vertical.paddingBottom}, left=${vertical.paddingLeft}`;
</script>

Result

horizontal: bottom=24px, left=0px
vertical: bottom=0px, left=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