Elements going under the nav bar

https://codepen.io/advitya-sharma/pen/eYpoxrj

the elements are going under the nav bar, and how can I make llinks in nav bar to be in horizontal direction with spacing ?
I used flex box but still links are vertical

Add the following style to your CSS:

nav ul {
  display: flex;
  justify-content: space-between;
  width: 300px;
}

Your header was flexed, but not your nav links. Adjust the justify-content and the width to get it to format and expand as you’d like.

yeah it changes the nav links but still the content is going under the nav bar

Do you mean that you want the nav bar to scroll with your page instead of always being visible?

no the content of my website is hiding behind navbar

Try making the content of your website larger and the navbar a tad smaller. I don’t know if that’s what you want but it might help.

see the link that might give you some idea

First of all, I was told recently that it is poor design to have a horizontal scroll bar.

Here is my code to help you out.

https://codepen.io/hopefulcodegirl/pen/MWaXORM

but I dont have horizontal scroll bar

You did when I last looked. What happened now?

Do you watch some youtube videos for your projects? Because I would suggest watching videos by this guy.

This guy has helpful videos for the freecodecamp challenges. But he does not do everything you would need to in order to pass the test . I

videos are good but currently I want content not to get behind navbar

Unfortunately, your test suite requires that that happens.

Your content is behind the navbar because your header has positioned fixed. Change it to position: sticky and add this to your CSS:

form {
  margin-top: 50px;
}

Avoid position fixed whenever you can.

1 Like

If you wish for the content to not be covered so much by the navbar, increase the size of your webpage.

Advitya-sharma cannot do that or the test won’t pass. The test suite said to have a fixed navbar.

This is what I’m reading from the test: “The navbar should always be at the top of the viewport.”

Yeah, that’s what it means. I tried using sticky before. When I do that I don’t pass that part of the test.

Strange, when I changed it to sticky it passed :thinking:

Now I am all confused.