Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialPatrick Stedman
1,598 PointsWhat's the difference between margins and padding? Both practically and theoretically.
See subject line. They both have to do with spacing but I'd be interested to know the benefits of using one over the over, and how they impact design.
4 Answers
William Li
Courses Plus Student 26,868 PointsHi, Patrick, check out this extensive article http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics1, it explains margins VS padding really well.
Andi Wilkinson
26,822 Pointswhat they said but I also like to think of a room, padding is the space between me and the four walls, the walls are the border, the margin is the land outside of the walls up to the edge of the garden!
Charles Loges IV
8,022 PointsMargin and padding may seem the same but are two different entities all together. padding is the space between the content and the border of an element while margin is the space between one element and another. take a look at this image of the box model it may help.
Patrick Stedman
1,598 PointsThanks guys!