Syntax | selector {padding: width width width width;}
(OR)
selector {padding: value;}
|
---|---|
Usage | The padding property is used as a shorthand method to specify all 4 padding widths in one place. See the Box Model for a description of the boxes that are generated for elements and the relative position of the padding area. Padding values cannot be negative. If a percentage value is used, the value will be a percentage of the containing block's width.
CSS Example: The padding property is set using a single value. .tst1 {padding: 40px; background-color: orange;} CSS Example: The padding property is set using 2 values. .tst1 {padding: 0.5em 65px; background-color: orange;} |
Keywords |
|
Applies To | All elements except elements with the following display types: table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column. |
Inherited | No |
Initial Value | 0 for each of the four individual padding sides. |