Definition and usage
The Padding-top property sets the top padding (space) of the element.
Description
This property sets the width of the padding within the element. The top padding set on the inline non-replacement element does not affect the row height calculation, so if an element has both an inner margin and a background, it can visually extend to other rows and may overlap with other content. You are not allowed to specify negative inner margin values.
Note: Negative values are not allowed.
| Default value: |
0 |
| Inheritance: |
No |
| Version: |
CSS1 |
| JavaScript Syntax: |
object. style.paddingtop= "10px" |
Possible values
| value |
Description |
| Length |
Specify the fixed upper and inner margin values in specific units, such as pixels, centimeters, etc. The default value is 0px. |
| % |
Defines the padding based on the percentage of the parent element's width. This value does not work in all browsers as expected. |
| Inherit |
Specifies that the upper padding should be inherited from the parent element. |
Note The Padding-top percent definition is based on the percentage of the parent element width on the inside margin!! is based on the width