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

Learning coding
seal-mask
.a{fill-rule:evenodd;}techdegree
Learning coding
Front End Web Development Techdegree Student 9,937 Points

How do I change the positioning in the navbar without having to rename classes and styling?

I have the same navbar at the bottom and the top. I also have the same H1 name at the bottom and the top. How do I get my bottom navbar and the h1 more to the bottom so it has the same distance as the top navbar and h1 to the top of the page?

If i change the navbar at the buttom now, the navbar at the top will change automatically in a way i don't want. Can someone help me with this?

https://w.trhou.se/fb0ce73ni1

Which selector are you using currently to target the bottom nav?

Hey there, I know this may sound crazy, but where is your closing tag for your top nav?

4 Answers

You don't necessarily have to change classes if you don't want to. You can further qualify the selector by looking at the html structure to see if there's something you can add to it to make it uniquely target the bottom nav and not also target the top nav.

For instance, your bottom .main-nav is within a section element with a class of "main-footer". You can use that to uniquely target the bottom nav.

The selector could be .main-footer .main-nav

You could have something like this then:

.main-nav {
  /* styles common to both top and bottom navs */
}

.main-footer .main-nav {
  /* styles for the bottom nav only to get the spacing right */
}

Let me know if I've misunderstood the problem.

Also, you could use the <footer> element at the bottom there to wrap all your elements that make up the footer instead of the <section> element. In that case your selector could be footer .main-nav

Learning coding
seal-mask
.a{fill-rule:evenodd;}techdegree
Learning coding
Front End Web Development Techdegree Student 9,937 Points

Thanks Jason, that's good to know. Only it doesn't solve the issue. When i adjust padding or margin the nav seems to be pushed down. Only that isn't so, because the whole page is moved down and i see the scrollbar at the right side become longer. When I scroll down I see that the navbar is still relative to where it was.

Ok, maybe you don't have the correct css for what you're trying to do.

Can you better describe what it is you're trying to do?

Learning coding
seal-mask
.a{fill-rule:evenodd;}techdegree
Learning coding
Front End Web Development Techdegree Student 9,937 Points

Hi Jason,

The goal is to push the bottom navbar and the h1 (h1=Rene van den Heuvel) more to the buttom of the page, so there is less margin between the h1 and the navbar. (in a way that is doesn't affect the top h1/navbar.