CodePen test problem: Navbar error. Please help

Hello good people of FCC,

I’m having this problem with the Codepen test for the portfolio page.

I have the nav links set up that when I click on them they go to the different sections, but when I do the codepen test I get this error:

“## 7. The navbar should contain at least one link that I can click on to navigate to different sections of the page.”

I cannot see the mistake. Please can someone take a look at the code and give me a hint. Thank you.

Here is the code for the navbar:

  <nav id="navbar">
    <a href="#welcome-section">
    <div class="logo">HattingH</div>
    </a>
    <ul>
      <li><a href="#welcome-section">Welcome</a></li>
      <li><a href="#projects">Projects</a></li>
      <li><a href="#contact">Contact</a></li>
    </ul>
  </nav>

——Then Continuing below that I have each section like this with an id so the link can navigate to that section. It works as it should, but the test says there is something wrong?——

<section id="welcome-section">

Do you have link to the source code? Looking at the above code, I think it is semantically wrong to nest a div element within an anchor tag.

Thanks I didn’t know that. . I put the anchor inside the div, but it still says the same.

Here’s the link:

Well, I try to fix the code but I couldn’t, the code really looks good to me. You did a great job as well. I will check the link later today.

Thanks for the compliment. I went back to the pen and pasted in the script for testing the projects on Codepen in the HTML section and now it passes. Must just have been a glitch with the pen that I had forked and then copied over their code. Thanks for taking the time and making an effort. Much appreciated.

1 Like