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

HTML

gaps between browser header navigation body and footer

When i write my codes using head body and footer, inside the body i added header section and then navigation and then other section, however it automatically gives me gaps between my header section with navigation as well as body section. Also from top from browser window to my header section there is huge gaps(white gaps) why it happens and how to ride off this gaps and make all together header navigation and body as well as footer. Thank you

This is a reason we use CSS Resets.

2 Answers

Might have to see your code.

Try a padding: 0; on the elements you're having trouble with and go from there.

Also open up dev tools in your browser and inspect the element, you can see where the spaces are coming from specifically.

The browser has its default styles so to avoid any unwanted styles there are several css resets you can use such as eric myers reset or a normalize.css you can then customize the code within the reset if you happen to like a default browser style. I like to use a reset to start fresh and avoid style wars :)