|
The CSS padding properties describe the space between the element border and the element content. CSS Padding Properties The CSS padding properties define the space between the element border and the element content. Negative values are not allowed. The top, right, bottom, and left padding can be changed separately using separate properties. A shorthand padding property is also created to control multiple sides at once. How to set the left padding of a tablecell? <!-- created by phpguru.biz --> td {padding-left: 2cm} <!-- created by phpguru.biz --> How all the padding properties in one declaration? <!-- created by phpguru.biz --> td.test1 {padding: 1.5cm} td.test2 {padding: 0.5cm 2.5cm} <!-- created by phpguru.biz --> Browser support: IE: Internet Explorer, F: Firefox, N: Netscape. PHPGURU: The number in the "PHPGURU" column indicates in which CSS proposal the property is defined (CSS1 or CSS2). | Property | Description | Values | IE | F | N | PHPGURU |
|---|
padding | A shorthand property for setting all of the padding properties in one declaration | padding-top padding-right padding-bottom padding-left | 4 | 1 | 4 | | padding-bottom | Sets the bottom padding of an element | length % | 4 | 1 | 4 | 1 | padding-left | Sets the left padding of an element | length % | 4 | 1 | 4 | 1 | padding-right | Sets the right padding of an element | length % | 4 | 1 | 4 | 1 | padding-top | Sets the top padding of an element | length % | 4 | 1 | 4 | 1 |
Examples Set the left padding of a tablecell This example demonstrates how to set the left padding of a tablecell. Set the right padding of a tablecell This example demonstrates how to set the right padding of a tablecell. This example demonstrates how to set the bottom padding of a tablecell.
All the padding properties in one declaration This example demonstrates how all the padding properties in one declaration.
|