Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Layout Basics Getting Started with CSS Layout Why Vertical Margins Collapse

Can't make heads or tails of what he's talking about. Is there a way he can point with a ruler at what he is referring?

I don't get anything he's saying because the objects he's referring to are not clear

2 Answers

John Haupenthal
John Haupenthal
2,749 Points

Just came to agree with post. An animated video of the margins or something would help, but there isn't much on the screen when he's breaking down what's happening with Google Dev and I found it difficult to follow.

Josh Olson
Josh Olson
13,236 Points

I thought it made sense. He's pointing at the individual elements inside the page. I guess it may not make sense if the HTML is complex or the structure is unknown. Perhaps it would be best if he simplified it.

In which case maybe a text tutorial could be helpful. https://css-tricks.com/what-you-should-know-about-collapsing-margins/

I see the 21 px now. But I can't find in the code how the <p> elements have a 16px margin?

Josh Olson
Josh Olson
13,236 Points

This is checked from the browser's developer tools. Right click an item on the page and select inspect element. On the sidebar right side lists all the styles used. Scroll down to the bottom and it will give you the box model dimensions with margins, border, padding, and size.

Treehouse also offers a course that looks at the Dev Tools for Chrome.