+ 1
Difference between margin and padding?
What's the difference between margin, padding, border and actual content in CSS?
5 Answers
+ 7
Padding is the space around the content, and the border is followed - if specified - around this; the margin is the space around all of them combined. Google box-sizing for some useful information, because this is where some developers have issues causing the element to collapse/spill or look odd when designing.
+ 3
Search for images of the html box model, it describes the terms better than words.
0
Remembering divs are boxes...margins happen outside the box, padding happens inside the box
0
let's say you have a house yh, so the DISTANCE or SPACE from a main road to your fence is the MARGIN and your fence can be seen as the BORDER, the DISTANCE or SPACE from your fence to your HOUSE is the PADDING. Your HOUSE is the content