CSS padding-left property
Examples
One P element left portion filling:
p
{
padding-left:2cm;
}
{
padding-left:2cm;
}
Attribute definitions and instructions
padding-left property sets a left padding element (space).
Note: negative values are not allowed.
Defaults: | 0 |
---|---|
inherit: | no |
version: | CSS1 |
JavaScript syntax: | object .style.paddingLeft = "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 a fixed unit left padding value, such as pixels, centimeters, and the like. The default value is 0px. |
% | Definition is based on the percentage left of the parent element within the width of the margins. This value does not work as expected, as in all browsers. |
inherit | Left padding provisions should inherit from the parent element. |
related articles
CSS tutorial: CSS the Padding