CSS Padding

CSS Padding

CSS Padding
The padding is the spacing between an element’s content and its border. 
By default, most elements have zero padding. 
An element’s padding is not inherited by its children. 
Padding can be specified with any size unit or with a percentage. 
When padding is specified as a percentage, the value used is the given percentage of the containing block’s width.
Syntax  - 
padding : value;
Padding on a given side  
The padding property sets the padding space on all sides of an element. 
The padding area is the space between the content of the element and its border.
Negative values are not allowed.
You can specify a side individually - 
  • padding-top 
  • padding-right 
  • padding-bottom 
  • padding-left 
Now we will see example - 
Example  -
Output -