Need help with the Personal Portfolio

Hello guys,

This is my pen link:

I am not able to pass all the tests.
I am getting this error and I have no clue how to remove it.

The navbar should always be at the top of the viewport. AssertionError: Navbar’s parent should be body and it should be at the top of the viewport : expected 40 to be close to 0 +/- 15
** at Function.assert.approximately**

Can someone please help?

Also, please suggest how to improve the layout etc.

When you scroll your page, you can see that your navbar is scrolling as well. Usually a navbar on a website always stays visible at the top of the page, even when scrolling down.

To achieve this you can take the navbar out of the flow of the page by using:
position: fixed;

If you scroll now you can see that the navbar stays in the same place. The second thing that the task asks is that it is at the top of the page, you can do this by setting an exact position:
top: 0;

In your case you will have to adjust the margin-top “to be close to 0 +/- 15”, as the test demands.

1 Like