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 trialRamzy Rashaun Arief
3,922 Pointscan someone tell me what is the different between padding and margin on css?
i'm confused
2 Answers
Alexander Davison
65,469 PointsA brief description:
Padding is for putting space around elements.
Margin is for moving elements.
I hope you understand now :)
Tomasz Halaczkiewicz
21,845 PointsPadding is a space added inside of an element, margin is a space outside of an element that seperates the element from other elements.
Johnathon Hill
6,074 PointsJohnathon Hill
6,074 PointsIf you think of elements on a page as 'boxes' , padding adds space within the element's 'box' and margin adds space on the outside of the element's 'box'.