CSS padding Property
CSS paddings are used to create space around an element while keeping it within any defined border. Individual sides can have different paddings (top, right, bottom, left). To implement padding properties, border properties must be added.
Syntax
Property Values
| Value | Description |
|---|---|
| length | Padding is specified in px, pt, cm, and other units. The default value is zero. Learn more about length units. |
| % | The padding is specified as a percentage of the width of the containing element. |
| initial | This property is set to its default value. |
| inherit | This property is inherited from its parent element. |
Supported Browsers
| Property | Chrome | Firefox | Safari | Edge / IE | Opera |
|---|---|---|---|---|---|
| padding | 1.0 | 1.0 | 1.0 | 4.0 | 3.5 |