property

padding — CSS reference

Shorthand for the four physical padding edges. One value fills all sides; two set vertical and horizontal; three set top, horizontal and bottom; four run clockwise from top. Initial longhands zero; not inherited. Negative lengths and auto are invalid. Percentages use the containing block inline size.

Formal Syntax & Structure

css syntaxcss
[ <length-percentage [0,∞]> ]{1,4}

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS box geometry lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}#a{padding:8px 12px 16px 20px}</style><body><div id="a" class="sample">Sample</div></body></html>
CSS Reference