CSS Properties

Margin Properties

This property is used to set the padding of specified element.

  • padding-left
  • padding-right
  • padding-top
  • padding-bottom
  • padding
Padding-left

This property is used to set left padding of element. We can set this property to length in the form of %, cm, px etc.

Example:

h1 {
padding-left: 40px;
}


Padding-right

This property is used to set right padding of element. We can set this property to length in the form of %, cm, px etc.

Example:

img {
padding-right: 20%;
}


Padding-top

This property is used to set top padding of element. We can set this property to length in the form of %, cm, px etc.

Example:

h1 {
padding-top: 40px;
}


Padding-bottom

This property is used to set bottom padding of element. We can set this property to length in the form of %, cm, px etc.

Example:

h1 {
padding-bottom: 40p
x; }


Padding

Its shorthand padding property It declares all padding properties in one single line. We can set this property to length in the form of %, cm, px etc.

Example:

img {
padding: 10px 20px
30px 40px;}


Cristle Academy

Compiler