English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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" |
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‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
length | Numeric values in units such as px, pt, cm, em, etc., cannot be negative. |
percentage | Specify percentage padding. The percentage is calculated relative to the width of the element's containing block. Negative percentage values are not allowed. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated element uses its parent element padding-The value of the bottom attribute. |
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.
|
See the following tutorials:CSS padding,CSS Box Model.
Related properties:padding,padding-top,padding-right,padding-left.