I need Help, Iam stucked at last point in my project, I need some help

I got the below error , can you please help me to rectify that or please explain how to remove this.

The navbar should always be at the top of the viewport.

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

without your code it is difficult to help

please give the link to your project

Hi thanks, for the reply. Here is my project link
https://codepen.io/niyasri/pen/eYvXmRY

First off, you didn’t close the nav </nav> so all the page content is inside it (it is auto closed).

Move the position CSS from .topnav to #navbar and make sure the top offset is 0.

ok thank you , i will check it out

again i got this error , please tell me how to fix it?

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

You have invalid CSS.

#navbar {
  offset-position: top;
  offset-position: 0;
}

Again, start by closing the nav element. You need to close it right after you close the .topnav div. Then add position: fixed and top: 0 to #navbar

Edit: BTW, if you want the nav to be full width you have to add width: 100% to it as well.


In case you need more help.

#navbar {
  position: fixed;
  top: 0;
}

I rectified that error. Thank you socmuch for your help.

Thank you so much for the help.

1 Like

No problem. Happy Coding.

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