I dont know what I am doing wrong the code just wont pass, the .nav-link and .main-section are the same numbers, but says they are not

<!DOCTYPE html>
<html lang="en">
<head>
  <link rel="stylesheet" href="styles.css">
<title>techinal document</title>
  </head>
  <body>
<nav id="navbar">    
 
     <header> <h1>JS Documentation</h1> </header> <ul> <li> <a class="nav-link" href="#Introduction">Introduction</a> </li> <li> <a class="nav-link" href="#What you should already know">What you should already know</a> </li> <li> <a class="nav-link" href="#JavaScript and Java">JavaScript and Java</a> </li> <li> <a class="nav-link" href="#Hello world">Hello world</a> </li> <li> <a class="nav-link" href="#Variables">Variables</a> </li> <li> <a class="nav-link" href="#Declaring variables">Declaring variables</a> </li> <li> <a class="nav-link" href="#Variable scope">Variable scope</a> </li> <li> <a class="nav-link" href="#Global variables">Global variables</a> </li> <li> <a class="nav-link" href="#Constants">Constants</a> </li> <li> <a class="nav-link" href="#Data types">Data types</a> </li> <li> <a class="nav-link" href="#if...else statement">if...else statement</a> </li> <li> <a class="nav-link" href="#while statement">while statement</a> </li> <li> <a class="nav-link" href="#Function declarations">Function declarations</a> </li> <li> <a class="nav-link" href="#Reference">Reference</a> </li> </ul>
    

    </nav>
   <main id="main-doc">
 <section class="main-section" id="Introduction"> <header><h3>Introduction</h3></header></section>

 <section class="main-section" id="What_you_should_already_know"> <header><h3>What you should already know</h3></header></section>

 <section class="main-section" id="JavaScript_and_Java"> <header><h3>JavaScript and Java</h3></header></section>

 <section class="main-section" id="Hello_world"> <header><h3>Hello world</h3></header></section>

 <section class="main-section" id="Variables"> <header><h3>Variables</h3></header></section>

 <section class="main-section" id="Declaring_variables"> <header><h3>Declaring variables</h3></header></section>

  <section class="main-section" id="Variable_scope"> <header><h3>Variable scope</h3></header></section>

   <section class="main-section" id="Global_variables"> <header><h3>Global variables</h3></header></section>

    <section class="main-section" id="Constants"> <header><h3>Constants</h3></header></section>

     <section class="main-section" id="Data_types"> <header><h3>Data types</h3></header></section>

      <section class="main-section" id="if..else_statement"> <header><h3>if...else statement</h3></header></section>

       <section class="main-section" id="while_statement"> <header><h3>while statement</h3></header></section>

        <section class="main-section" id="Function_declarations"> <header><h3>Function declarations</h3></header></section>

    <section class="main-section" id="Reference">
<header><h3>Reference</h3></header>
<ul>
  <li>All the documentation in this page is taken from <a class="nav-link" href="#MDN"</a>MDN</li>

 
</ul>
 </section>
    </main>
    </body>
</html>

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

    1. All of your .nav-link elements should be in the #navbar.
  • Failed:17. You should have the same number of .nav-link and .main-section elements.

I’m building a technical page and this the 2 errors I keep getting, I don’t know what I’m doing wrong

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

It’s easier to read your code if it is properly formatted. There are free online code formatters which can help you with this.

You have an additional .nav-link element, which is not inside your navbar. This will be why you are failing both of those tests.

thank you, I managed to do it.

1 Like