CKTIS / CSS
padding-left — left-side padding
The padding-left property sets the internal spacing on the left side of a CSS box. It accepts a nonnegative length or percentage and always targets the physical left side.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
padding-left: <length-percentage [0,∞]>;padding-left specifies the thickness of the padding between the content and the box’s left border. Unlike margin-left, it creates space inside the border rather than outside it. The padding shorthand sets padding on all four sides.
The initial value is 0; the property is not inherited. It accepts a nonnegative length or percentage, such as 16px or 10%. Negative values and auto are invalid. A percentage refers to the containing block’s logical width: in horizontal writing mode, its width, not the element’s own width.
This is a physical property: changing text direction does not move the padding to the right side. For spacing that follows the start of a line, use padding-inline-start, whose mapping depends on writing mode and direction.
In the example, the containing block is 200px wide and uses horizontal writing mode. Therefore, padding-left: 10% produces an expected padding of 20px. The other sides have 0 because the earlier padding: 0 resets them.
Examples
<!doctype html>
<meta charset="utf-8">
<title>padding-left</title>
<style>
.container { width: 200px; writing-mode: horizontal-tb; }
.box { padding: 0; padding-left: 10%; background: #def; }
</style>
<div class="container">
<div class="box">CSS</div>
</div>Result
padding-left: 20px
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.