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 trialRafael Marcano
3,735 PointsWhat does he say about margin at 01:50?
I don't quite understand what he says about the margin property at 01:50 in the video. He says that "margin has a tendency to push...even if they're (something I don't understand) of the element".
I would like to know why he chose to add padding instead of margin.
2 Answers
bothxp
16,510 PointsHi Hi Rafael,
Normally I'd say that if you are having problems understanding what the teacher is saying then take a look at the Video Transcript option that is just below the video.
But in this case the transcript reads: 1:47 - This is better because margin has a tendency to 1:50 - push elements even if they're side of the parent container. 1:54 - In other words, they push elements where they shouldn't.
I'm guessing that Nick didn't say "even if they are side of".
I'm guessing that he said either 'inside' or 'outside'.
Rafael Marcano
3,735 PointsYes I assumed it might be "inside", I just wasn't sure. I'm still not quite clear on how margin and padding works exactly.
Thanks!
lucybeck
6,055 PointsHi Rafael, Just imagine you have a
box = margin (outside)<br>
You are sending goods in it, so have some <br>
padding = inside
Lukas Muller
7,347 PointsLukas Muller
7,347 PointsHe was referring to the difference of margins and paddings. Margins are outside of a box/div, paddings inside.
I hope this helps you :)