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 trialEhsan Raza
263 PointsHi guys. Can anyone explain to me why Guilh uses padding and margin for grid container? What's the use of it?
I need the answer plz.
2 Answers
Thas Eagans
Courses Plus Student 2,533 Pointspadding adds space between content and border, while margin adds space between different objects (containers, etc).
</TREagans>
Carman A
7,672 PointsBut basically padding adds to an element, but no content can go inside it. Think of it like a border for a border. Margin is the space between an element, and it's neighbor; in which nothing in the flow of the document is allowed.
Carman A
7,672 PointsI haven't watched the video for awhile(don't have time right now) but it's probably just to suit his layout needs. And add/remove space between elements.
Carman A
7,672 PointsCarman A
7,672 Pointsyeah what he said.