Unable to pass fixed nav bar test - Product Landing Page

my navigation bar is always on top but it’s not passing the freecodecamp test.

https://codepen.io/moseschand003/pen/PoqVNBN

I’m sorry, but I’m going to need a bit more information than that in order to help you. I really want to help but I have no idea what you’re asking :expressionless:

1 Like

Perhaps your added js scripts are interfering with the testing scripts?

1 Like

@sanity I don’t believe that’s the issue

1 Like

@Moseschand003, the problem is where you placed the script. When using codepen it only expects the code you’d put within the <body> </body> tags in HTML. (No need to include the body tags). For anything you want to add to <head> click on the ‘Settings’ button, then HTML and add it into the ‘Stuff for <head>’ box.

  • The link to your font would go in the box labeled ‘Stuff for <head>’

Normally JS scripts would appear before the closing body tag so that you page still loads and content can be seen if there’s an issue. By moving both scripts that you have in the head to just above the closing body tags the test all pass successfully.

1 Like

There’s a navigation bar on top. Right? It’s not passing the test. You run for yourself and check once. Thanks for your kindness.

Hey!

@Roma is on point. I have run the tests and the only thing you have to move is the code between script tags from the HTML section to the JS section in the codepen editor and run the tests again.

Happy coding! :slight_smile:

1 Like

As said, the problem is with the smooth-scroll script.

Just click the Settings button and go to the JS section, now add the script in one of the bottom boxes and remove it from the HTML.

1 Like

Thanks everyone !!! It’s working now. Was burning for this one error !!! Love you all <3 FCC Community !!!

1 Like