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 CSS Basics (2014) Basic Selectors ID Selectors

Saleh Ben Nakhi
Saleh Ben Nakhi
7,305 Points

structure of elements

I can't understand why there is a gap between the header in orange and the solid red line of primary content as margins were set to 0. can someone explain please?

Do you also have some padding?

Posting some code would help us help you. :)

3 Answers

Matthew Stanley
Matthew Stanley
1,071 Points

I know this is an old question, but maybe this answer will help future students.

The body element has had its margins removed. But that only eliminates the blank space on the outside of the body, the very edges of the page. It does not affect the children of body, such as paragraphs and headers. The other elements have the default margin.

Dylan Young
Dylan Young
15,752 Points

No code to see so i'm not sure, but usually that similar issue can be resolved with additional padding.

Saleh Ben Nakhi
Saleh Ben Nakhi
7,305 Points

hi guys, its the exact same code as in the video tutorial. there was no padding and no margins.