The padding property sets the paddings of an element.
div {
padding: 5px 10px 15px 20px;
}
Property |
Value |
Explanation |
padding |
length, %, or auto |
the top, bottom, left, and right paddings |
padding: 2px;
: [all sides] paddings
padding: 2px 4px;
: [top, bottom] [left, right] paddings
padding: 2px 4px 6px;
: [top] [left, right] [bottom] paddings
padding: 2px 4px 6px 8px;
: [top] [right] [bottom] [left] paddings
Example