English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Comprehensive List of CSS Attributes

CSS padding-Usage and examples of bottom attribute

padding-The bottom CSS attribute sets the padding to the bottom side, which is the space between the bottom border and the content of the element. However, in many cases, it is better to use shorthand CSS propertiespaddingMore commonly used and preferable.

The following table provides usage instructions and version history of this attribute, as well as the syntax of using this attribute in JavaScript scripts.

Default value:0
Applies to:All elements, except<tbody>,<thead>,<tfoot>,<tr>,<colgroup>and<col>. It also applies to::first-letter.
Inheritance:No
Can be animated:Yes.Please refer to Animation properties.
Version:CSS 1,2,3
JavaScript syntax:object.style.paddingBottom="2cm"

padding-The syntax of bottom usage

The syntax of this attribute is as follows:

padding-bottom: length | percentage | initial | inherit

The following examples demonstrate how to use padding-bottom attribute.

  h1 {
   padding-bottom: 2em;
  }
  p {
   padding-bottom: 50px;
  }
Test and see‹/›

Attribute value

The following table describes the value of this attribute.

ValueDescription
lengthNumeric values in units such as px, pt, cm, em, etc., cannot be negative.
percentageSpecify percentage padding. The percentage is calculated relative to the width of the element's containing block. Negative percentage values are not allowed.
initialSet this attribute to its default value.
inheritIf specified, the associated element uses its parent element padding-The value of the bottom attribute.

Browser compatibility

padding-Browser compatibility of the bottom attribute, the numbers in the following table represent the minimum version number of the browser that supports this attribute; all mainstream browsers support this attribute.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 4+

  • Apple Safari 1+

  • Opera 4+

Read more

See the following tutorials:CSS padding,CSS Box Model.

Related properties:padding,padding-top,padding-right,padding-left.