CSS Padding Property
How to use the CSS padding to control elements on a page.
The CSS padding property is the short-hand way of specifying padding.
Padding is used to create a space between an elements content, and its borders. But it is also used as "margin", places where margin is problematic to use. Padding can look exactly like margin, when used on elements without a background.
Possible Values
- auto (Default)
- Units of Measurement
Note: Negative values is not allowed for padding.
Using CSS padding
This example, sets the padding in the following format: Top Right Bottom Left
p {
padding: 2em 1em 3em 4em;
}
The above is the equivalent of:
p {
padding-top: 2em;
padding-right: 1em;
padding-bottom: 3em;
padding-left: 4em;
}
Inherited? NO!