1
Reply

What is the difference Between Padding and Margin?

swathi J

swathi J

Jun 02, 2016
148
0

    PaddingPadding is a CSS property that defines the space between an element content and its border (if it has a border). If an element has a border around it, padding will give space from that border to the element content which appears in that border. If an element does not have a border around it, then adding padding has no effect at all on that element, because there is no border to give space from.MarginMargin is a CSS property that defines the space of outside of an element to its next outside element.Margin affects elements that both have or do not have borders. If an element has a border, margin defines the space from this border to the next outer element. If an element does not have a border, then margin defines the space from the element content to the next outer element.

    swathi J
    June 02, 2016
    0