Difference between a View's Padding and Margin

后端 未结 14 2910
渐次进展
渐次进展 2020-11-22 06:45

What is the difference between a View\'s Margin and Padding?

相关标签:
14条回答
  • 2020-11-22 07:11

    Padding is the space inside the border, between the border and the actual view's content. Note that padding goes completely around the content: there is padding on the top, bottom, right and left sides (which can be independent).

    Margins are the spaces outside the border, between the border and the other elements next to this view. In the image, the margin is the grey area outside the entire object. Note that, like the padding, the margin goes completely around the content: there are margins on the top, bottom, right, and left sides.

    An image says more than 1000 words (extracted from Margin Vs Padding - CSS Properties):

    alt text

    0 讨论(0)
  • 2020-11-22 07:11

    In simple words:
    padding changes the size of the box (with something).
    margin changes the space between different boxes

    0 讨论(0)
提交回复
热议问题