Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

CSS property `padding-block`

`padding-block` sets inner space at the start and end of the logical block axis.

Version: CSS modules; captured CSSWG editor index includes draft and obsolete features requiring review

Syntax

<'padding-top'>{1,2}

padding-block sets inner space at the start and end of the logical block axis.

The example uses writing-mode:vertical-rl and reports physical padding-left/padding-right, demonstrating that the logical block axis maps horizontally.

Grammar: <'padding-top'>{1,2}.

Padding enlarges a content-box sized box; percentages resolve against the containing block inline size and negative values are invalid.

Examples

<!doctype html><html lang="en"><meta charset="utf-8"><title>CKTIS CSS example</title><body><pre id="result"></pre><script>const x=document.createElement("div"),c=document.createElement("i");document.body.prepend(x);x.append(c);x.style.cssText="box-sizing:content-box;width:80px;height:40px;writing-mode:vertical-rl;padding-block:10px 20px";c.style.cssText="display:block;width:10px;height:10px";const a=x.getBoundingClientRect(),s=getComputedStyle(x);document.querySelector("#result").textContent="box="+Math.round(a.width)+"x"+Math.round(a.height)+"; physical-left="+s.paddingLeft+"; physical-right="+s.paddingRight+"; computed="+s.paddingBlock;</script></body></html>

Result

box=110x40; physical-left=20px; physical-right=10px; computed=10px 20px

The example was executed locally in an isolated, network-free Chrome session; the result comes from the browser CSS API.

Sources