Property | Description | Possible Values | Examples |
---|---|---|---|
padding-top | Declares the top padding for the element. | Lengths, percentages, and the predefined value auto. | div { padding-top:5px; } div { padding-top:15%; } |
padding-right | Declares the right padding for the element. | Lengths, percentages, and the predefined value auto. | div { padding-right:5px; } div { padding-right:15%; } |
padding-bottom | Declares the bottom padding for the element. | Lengths, percentages, and the predefined value auto. | div { padding-bottom:5px; } div { padding-bottom:15%; } |
padding-left | Declares the left padding for the element. | Lengths, percentages, and the predefined value auto. | div { padding-left:5px; } div { padding-left:15%; } |
padding | Shorthand property used to declare all the margin properties at once. | Separate values by a space in the following order (those that are not defined will use inherited or default initial values): padding-top Undeclared values work as further shorthand notation. If only one length value is declared, all four sides will use that length. If two lengths are declared, the top and bottom sides will use the first length while the right and left sides will use the second length. If three lengths are declared, the top side will use the first length, the right and left sides will use the second length, and the bottom side will use the third length. | div { padding:5px 12px 4px 7px; } div { padding:5px; } div { padding:5px 10px; } div { padding:5px 7px 4px; } |