In W3 CSS and also in XUL/CSS? (not between CSS and XUL/CSS).
Use a margin when you want to adjust the spacing of an element and use padding when you want to adjust the appearance of the element itself. Margins aren't a part of the element; padding is.
margin and padding are the two most commonly used properties for spacing-out elements. A margin is the space outside something, whereas padding is the space inside something.
Margin is the outer space of an element, while padding is the inner space of an element. In other words, margin is the space outside of an element's border, while padding is the space inside of its border.
I recommend this article for you. The diagram is from that article.
http://elegantcode.com/2010/01/26/css-basics-the-box-model/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With