Portfolio test, says navbar should stay at the top

this is my code, i keep on failing the last part, and i dont know why, since the navbar it IS at the top, and stays there even if i scroll

(i even copied the code from the original source to see if that would fix it, and nothing works)

Fork Me! FCC: Test Suite Template by Alexandra (@Alex_DS) on CodePen.

Hello and welcome to the forum :grin:!

Yes, that’s true, but the tests are meant to find which elements you’ve learned and applied. In your case, even though it’s at the top it’s not the right way to do it:

  • First of all, your navbar reference, on the CSS, is wrong. It should be #navbar, since the nav element has an id attribute with value of navbar.
  • The expected way to do it is to add a position fixed to the navbar:
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%; /* without this, the navbar will shrink */

That should help you fix your problem :slight_smile:,

Happy coding!

1 Like

HELLO!!! THANK YOU SO MUCH!!! no wonder it wouldnt work! this shows how much of a noob i am i am so sorry, it was so obvious now that you said it!

thank you thank you thank you!

1 Like

Don’t worry :slight_smile:, we’re all noobs at some point (I feel like a noob sometimes too :laughing:).

Keep it up and happy coding!

1 Like