C4f34e76 516f 40f8 82d6 2961fd41aa79

CSS Padding

The CSS padding properties are used to generate space around content.

The padding properties set the size of the white space between the element content and the element border.

Padding Individual Sides

CSS has properties for specifying the margin for each side of an element.padding-toppadding-rightpadding-bottompadding-left

Example

p {
padding-top: 50px;
padding-bottom: 80px;
padding-right: 50px;
padding-left: 10px;
}


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 the following individual padding properties.padding-toppadding-rightpadding-bottompadding-left

Example

p {
padding: 50px 30px 50px 80px;
}


Scroll to Top