Tuesday 22 January 2019

What are Padding and Margin Property in CSS? tccicomputercoaching.com

CSS Padding and Margin Properties are very useful during website design .

The padding properties set the size of the white space inside the border.


Padding - Individual Sides

CSS has properties for specifying the padding for each side of an element:
  • padding-top
  • padding-right
  • padding-bottom
  • padding-left
All the padding properties can have the following values:
  • length - specifies a padding in px, pt, cm, etc.
  • % - specifies a padding in % of the width of the containing element
  • inherit - specifies that the padding should be inherited from the parent element
But Negative values are not allowed.

For Example,

div {
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 80px;
}

Margin - Individual Sides

The margin properties set the size of the white space outside the border.

With CSS, you have full control over the margins. There are CSS properties for setting the margin for each side of an element (top, right, bottom, and left).

For Example,

div {
  • margin-top
  • margin-right
  • margin-bottom
  • margin-left
}

To learn more about CSS in detail Join TCCI in Bopal and satellite in Ahmedabad.

Online Coaching is available.

Call us @ 9825618292

Visit us @ http://tccicomputercoaching.com/course/

No comments:

Post a Comment