CSS padding-bottom 属性
- Previous Page padding-block-start
- 下一页 padding-inline
Definition and Usage
The paddingBottom property sets the bottom inner padding (bottom blank) of the element.
Description
This property sets the width of the bottom inner padding of the element. The bottom inner padding set on inline non-replaced elements does not affect the line height calculation, so if an element has both padding and background, it may visually extend to other lines and may even overlap with other content. Negative padding values are not allowed to be specified.
Note:Negative values are not allowed.
See Also:
CSS Tutorial:CSS 内边距
HTML DOM Reference Manual:paddingBottom Property
Example
Set the bottom inner padding of the p element:
p { padding-bottom:2cm; }
(More examples can be found at the bottom of the page)
CSS Syntax
padding-bottom: length|initial|inherit;
Property Value
Value | Description |
---|---|
length | Specifies a fixed bottom inner padding value in specific units, such as pixels, centimeters, etc. The default value is 0px. |
% | Specifies a percentage bottom inner padding based on the parent element's width. This value does not work as expected in all browsers. |
inherit | Specifies that the bottom inner padding should be inherited from the parent element. |
Technical Details
Default Value: | 0 |
---|---|
Inheritance: | no |
Version: | CSS1 |
JavaScript Syntax: | object.style.paddingBottom="10px" |
TIY Example
- Set bottom inner padding 1
- This example demonstrates how to set the bottom inner padding of a cell using centimeter values.
- Set bottom inner padding 2
- This example demonstrates how to set the bottom inner padding of a cell using percentage values.
Browser Support
The numbers in the table indicate the first browser version that fully supports this attribute.
Chrome | IE / Edge | Firefox | Safari | Opera |
---|---|---|---|---|
1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
- Previous Page padding-block-start
- 下一页 padding-inline