Padding

Padding

The padding properties allows to specify how much space should appear between the content of an element and its border.

Syntax: property: value;
Values: length | percentage
Default: 0
Applies to: all element
Inherits: no

padding-top

 The padding-top property specifies the top padding of an element.

Example
p { padding-to: 2em;
 background-color: red;
 display: inline-block;
 color: green;
 font-family: Arial;
 margin: 1px 2px 1px 2px;
 }
padding-right

 The padding-right property specifies the right padding of an element.

Example
 p { padding-right: 4em;
 background-color: red;
 display: inline-block;
 color: green;
 font-family: Arial;
 margin: 1px 2px 1px 2px;
 }
padding-bottom

 The padding-bottom property specifies the bottom padding of an element.

Example
 p { padding-bottom: 2em;
 background-color: red;
 display: inline-block;
 color: green;
 font-family: Arial;
 margin: 1px 2px 1px 2px;
 }
padding-left

 The padding-left property specifies the left padding of an element.

Example
 p{ padding-left: 4em;
 background-color: red;
 display: inline-block;
 color: green;
 font-family: Arial;
 margin: 1px 2px 1px 2px;
 }
padding

 The padding property is used to specify all padding in one declaration.

Example
 p { background-color: red;
 display: inline-block;
 color: green;
 font-family: Arial;
 margin: 1px 2px 1px 2px;
 padding: 2em 4em 2em 4em;
 

Leave a Reply