The CSS padding properties are used to generate space around an element's content, inside of any defined borders.

With CSS, you have full control over the padding. There are properties for setting the padding for each side of an element (top, right, bottom, and left).

Padding - Individual Sides

CSS has properties for specifying the padding for each side of an element:

Padding - Shorthand Property

To shorten the code, it is possible to specify all the padding properties in one property. The padding property is a shorthand property for specifying the padding for each side of an element.

If the padding property has four values:

If the padding property has three values:

If the padding property has two values:

If the padding property has one value: