Previous | Home | Next |
CSS padding is used to define the space between the element border and the element content. Padding has property to clear an area around the content (inside the border) of an element and padding is affected by the background color of the element.
Padding can be top, right, bottom, and left, and it can be changed independently using separate properties.
Value | Description |
length | Defines a fixed padding (in pixels, pt, em, etc.) |
% | Defines a padding in % of the containing element |
For Example
padding-top:25px; padding-bottom:25px; padding-right:50px; padding-left:50px;
CSS Padding property can have following values.
padding:25px 50px 75px 100px;- top padding is 25px
- right padding is 50px
- bottom padding is 75px
- left padding is 100px
- top padding is 25px
- right and left paddings are 50px
- bottom padding is 75px
- top and bottom paddings are 25px
- right and left paddings are 50px
- all four paddings are 25px
Previous | Home | Next |