Menu Home

padding

osbo.com | CSS | Properties | padding

The padding CSS property is shorthand for padding-top, padding-right, padding-bottom, and padding-left.

Syntax

CSS

padding: value;

JS

object.style.padding = "value";

Values

<'padding'> = <'padding-top'>{1,4}
<'padding-top'> = <length-percentage>
<length-percentage> = [ <length> | <percentage> ]
<length>

Specifies the length using a number followed by a unit of measurement.

<percentage>

Specifies the percentage using a number followed by a percent sign (%).

Initial

0

Examples

length

percentage

JS

Internal

padding-bottom

padding-left

padding-right

padding-top

External

World Wide Web Consortium (W3C)