Product Landing Page - nav bar

Hi I am working on my Product Landing Page and I can’t seem to understand why I cannot fulfil the navbar requirement.

It keeps saying “Your #nav-bar should always be at the top of the viewport.” Will appreciate if someone spots the error.

https://codepen.io/kmsineka/pen/zxrxRKBThank you.

please share the link to the project on freeCodeCamp

you define top: 1 em have you considered that it can be not to the top enough?

maybe try a smaller value

Even when I try 0, it shows error

when i do a basic styling like this for #nav-bar, it shows error as well

Should that style be applied to the nav or the nav’s containing element?

I have tried replacing it with header and nav as well, can’t seem to pass the test

I don’t see any changes to your codepen. Can you show here how you have styled header and nav?

I took your code, made that change, and it passes for me

I have saved the code with the changes.

Your solution works from my end. Please try one of the following steps to move forward.

Click on the “Restart Step” button and force a refresh of your page with CTRL + F5 then try to paste the code in again.

or - Try the step in incognito or private mode.

or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

or - Ensure your browser is up-to-date or try a different browser.

I hope one of these will work for you.