CSS padding-top property
Attribute definitions and instructions
padding-top property is set at the top padding of an element (space).
Note: negative values are not allowed.
Defaults: | 0 |
---|---|
inherit: | no |
version: | CSS1 |
JavaScript syntax: | object .style.paddingTop = "2cm" |
Browser Support
Figures in the table represent the first browser to support the version number of the property.
属性 | |||||
---|---|---|---|---|---|
padding-bottom | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Property Value
value | description |
---|---|
length | Specific provisions in terms of units fixed to the inner margin values, such as pixels, centimeters, and the like. The default value is 0px. |
% | Definition of the percentage of the parent element based on the width of the margins. This value does not work as expected in all browsers. |
inherit | Margins should be specified from the parent element inheritance. |
related articles
CSS tutorial: CSS the Padding