Grammar:
padding: [<length> | <percentage>]{1,4}
Default value : see each individual property
applies to : all elements, except Table-row-group | Table-header-group | Table-footer-group | Table-column-group | Table-row outside
Inheritance : None
Animation : Yes
calculated values : see each independent property
related Properties : [Padding-top] | | [Padding-right] | | [Padding-bottom] | | [Padding-left]
Value:
<LENGTH>: Use length values to define the inner filler. Negative values are not allowed
<percentage>: Defines the inner filler in percent. In the horizontal (default) Writing mode, it is calculated with reference to its containing block width, and other cases refer to height. Negative values are not allowed
Description
retrieves or sets the internal margins of the four edges of an object.
If you provide all four parameter values, the top, right, bottom, and left orders are used for four edges.
If only one is provided, it will be used for all four sides.
If two is provided, the first one is for top, bottom, and second for left and right.
If three is supplied, the first one is used on, the second one is for left, right, and the third is for the next.
Non-substituted (non-replaced) inline elements can use this property to set the inner patches on the left and right sides, and to set the inner patches on the upper and lower sides, you must first make the object appear as a block-level or inline block-level.
The corresponding script attribute is padding.
Trbl
Extension: Margin,border
padding the value abbreviation
padding: 20px; = = padding: 20px 20px 20px 20px;
padding: 20px 10px; = = padding: 20px 10px 20px 10px;
padding: 20px 10px 30px = = padding: 20px 10px 30px 10px;
Opposite is equal, the latter is omitted; 4 faces are equal, only one is set
<! DOCTYPE html>