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

Header and nav elements overflowing.

Hi everyone,

I've been going through my second run-through of Nick's 'How to Build a Website' beginner tutorial, and along the way have been tinkering and altering a few things to make it more customized.

It's been going pretty well so far, the only thing I noticed was a very weird overlapping of the background colors of the header and the nav at the top...which I can't seem to diagnose.

Any help would be very much appreciated...I'm sure it's something simple my eyes just can't see :)

Adam

https://w.trhou.se/ubaof7fp50

What is it exactly that you want to change? What exactly is the desired result? Do you want the nav at the top to be placed below the header? Or merely remove the nav's background color?

Hi Saskia,

I probably should have mentioned that haha. I just want the background color of the nav to be the last thing that separates the header from the rest of the body, but right now the header background is leaking below the nav background.

1 Answer

To achieve the desired result, change your nav css like so:

nav {
  text-align: center;
  padding: 10px 0;
  margin: 20px 0 0; }

This will remove the bottom margin.

Thank you very much :)

You are welcome!