Your #navbar element should always be at the top of the viewport

I’m currently working on a profolio. It says the navbar still needs to be on the top of the viewport. I’m really confused as I think I got it right.
Here’s my code:

HTML:


 <!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <nav id="nav-bar">
      <a href="#welcome-section" class="nav-link">Welcome</a>
      <a href="#projects" class="nav-link">Projects</a>
    </nav>
    <section id="welcome-section">
      <h1 id="name">Meet Henry V.</h1>
    </section>
  </body>
</html>

CSS:

body {
  margin: 0;
  padding: 0;
}

#nav-bar {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  z-index: 9999; 
}

“Your #navbar element should always be at the top of the viewport.”

Your nav bar element:

<nav id="nav-bar">

Do you see the discrepancy?

1 Like

Ok, yeah that was it. Man I’m silly.

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