CSS padding-bottom Property

CSS padding-bottom property defines the padding for the bottom side of an element. The padding-bottom is the space between the content and the bottom border of an element.

The padding-bottom property can be specified in any valid CSS length formats such as ‘px’, ’em’, ‘rem’, ‘cm’, etc. It can also be specified using percentage(%). It does not accept negative values.

Example:

.p1{
  padding-bottom: 20px;
}
.p2{
  padding-bottom: 2.5em;
}
.p3{
  padding-bottom: 10%;
}

CSS Syntax

The padding-bottom property has the following syntax:

padding-bottom: length|percentage|initial|inherit;

Property Values

The padding-bottom property accepts the following values:

lengthSets a fixed bottom padding in CSS length formats such as ‘px’, ’em’, ‘rem’, ‘cm’, etc. The default value is zero.
percentageSets bottom padding in percentage. The percentage value is calculated by taking the percentage of the element’s width itself.
initialSets the padding-bottom property to its default value(0).
inheritInherits the padding-bottom property from the parent element.

General Info

Default Value0
InheritedNo
JavaScript Usageelement.style.paddingBottom = “40px”