CSS - Padding properties
Paddings are part of the box formatting model. Each element formatted in this model is in one or more rectangular boxes representing the padding, border and margin areas.
The padding Properties determine how much space is to be inserted between the border and the actual content of the element.
|
Padding |
|||
Property |
Description |
Values |
Sample Code |
padding |
Sets all of the padding properties of an element from one to four values |
length |
p {padding: 2em 2em} |
padding-bottom |
Sets the bottom padding properties of an element |
length |
p {padding-bottom: 5px} |
padding-left |
Sets the left padding properties of an element |
length |
p {padding-left: 12px} |
padding-right |
Sets the right padding properties of an element |
length |
P {padding-right: 10%} |
padding-top |
Sets the top padding properties of an element |
length |
P {padding-top: 2px} |
Samples
Result:
CSS Padding {padding: 5px 10px 5px 10px; } (TOP LEFT BOTTOM RIGHT)

