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 trial

CSS How to Make a Website Styling Web Pages and Navigation Style the Image Captions

What'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

Andi Wilkinson
Andi Wilkinson
26,822 Points

what 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!

Margin 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.

http://www.w3schools.com/css/box-model.gif

Thanks guys!