Need help in personal portfolio webpage
Error: navbar element should be at the top of the viewport

They want the position:fixed property on the nav directly. replacing your CSS selector header with nav passes all tests.


thnk u very much , i cleared it .

Technically, I believe it’s just the default margin on the ul that is pushing it down.

Navbar’s parent should be body and it should be at the top of the viewport : expected 16 to be close to 0 +/- 15

The number 16 in the message is the default 16px margin-top on the ul.

So this should work as well:

header {

ul {
  margin: 0;

BTW, you have a lot of errors in your HTML. Use the down arrow on the right side of the HTML code box and select the Analyze HTML option (or use something like the w3 validator).

Edit: I would suggest switching the Syntax Highlighting on Codepen. It will help catch syntax errors.

Go to your Codepen profile settings. Under “Editor Preferences” switch the Syntax Highlighting to Oceanic Dark and save the setting. Go back to the pen and make sure your new setting is working, the code highlighting will be using different colors. If there are issues you should see tags marked in red. That is the new Syntax Highlighting showing you where the problems are.


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.