CSS padding
Also see the full, alphabetical list of CSS properties
The CSS padding property is CSS shorthand for specifying padding on all sides of an element. In other words, it is shorthand property for setting padding-top, padding-right, padding-bottom, and padding-left all at once.
You could think of it as the CSS equivalent to cellpadding in HTML, however, CSS padding is more powerful - it can be applied to any element, not just table cells. Also, you can apply different padding values to each side of an element.
To apply the CSS padding property to table cells you need to apply padding at the cell level (i.e. you style the <td> tag - not the <table> tag). See CSS Cellpadding for more information.
| Syntax: | padding: <value1> <value2> <value3> <value4>; |
| Possible Values: |
|
| Initial Value: | Not defined |
| Applies to: | All elements. |
| Inherited: | No |
| Media: | Visual |
| Example: |
|
| Try it yourself! |
|
Also see padding-top, padding-right, padding-bottom and padding-left.
