HTML & CSS · Junior · Question 14 of 75
How does padding differ from margin?
- 1
paddingis outer spacing (transparent),marginis inner spacing (painted with background) - ✓Correct answer:
paddingis inner spacing (painted with background),marginis outer spacing (always transparent) - 3No difference: they are interchangeable properties with different names
Explanation
The box model order is content → padding → border → margin. padding sits inside the border and is painted with the element's background; margin is outside and transparent. Also, vertical margins of adjacent blocks can collapse while padding never does, and margin can be negative while padding cannot.