Technical Documentation Page - Build a Technical Documentation Page

I have gotten all of the tests correct except this one: "Each .nav-link should have an href attribute that links to its corresponding .main-section (e.g. If you click on a .nav-link element that contains the text “Hello world”, the page navigates to a section element with that id) " and I know the problem is in my “a” links, but I don’t know how to fix it.

<!-- file: index.html -->
<main id="main-doc">
  <section class="main-section" id="Making_Code">
    <header>Making Code</header>
    <p>Coding can be easy, though it can also be hard. Sometimes it is easy to write but hard to understand, and sometimes vice versa. Either way, I'm gonna show you have to correctly make basic starter code.<br></p>
    <p>We'll be working with HTML. </p>
  </section>
  <section class="main-section" id="Step_1">
    <header>Step 1</header>
    <p>Start with this:<code> !DOCTYPE html </code></p>
    <p>Make sure to add < before and > after.</p>
  </section>
  <section class="main-section" id="Step_2">
    <header>Step 2</header>
    <p> Have a html element with this:      
<code>lang ="en"</code> inside it.</p>
    <p> don't forget to put the "en" inside quotation marks!</p>
  </section>
  <section class="main-section" id="Step_3">
    <header>Step 3</header>
    <p>Add one head and one body element. Put a meta element inside the head, and give the meta a <code>charset="UTF-8"</code> </p>
    <p>in another meta give it a name of viewport and <code>content="width=device-width, initial-scale=1.0"</code></p>
  </section>
  <section class="main-section" id="Step_4">
    <header>Step 4</header>
    <p>Still inside the head, add a title, then continue with your code!</p>
    <p>remember: 
      <ul>
        <li>The !DOCTYPE doesn't have a closing tag.</li>
        <li>only use the meta <code>content="width=device-width, initial-scale=1.0" when you are making a responsive webpage.</code></li>
        <li>the meta doesn't need a closing tag.</li>
        <li>Don't feel bad if you don't get it right at first, all greatness takes time.</li>
        <li>There is a difference between html and css.</li>
      </ul>
    </p>
  </section>
</main>
<nav id="navbar">
  <header>
    <a class="nav-link" href="Making_Code">Making Code</a>
    <a class="nav-link" href="!DOCTYPE html">Step 1</a>
    <a class="nav-link" href="lang="en"">Step 2</a>
    <a class="nav-link" href="charset="UTF-8"">Step 3</a>
    <a class="nav-link" href="remember:">Step 4</a>
  </header>
</nav>
<link rel="stylesheet"
href="styles.css">
/* file: styles.css */
@media (max-width: 1000px){
  body{ background: white;

  }
}
.main-section{font-family: Times New Roman;}
a{font-family: Times New Roman;}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0

Challenge Information:

Technical Documentation Page - Build a Technical Documentation Page

Within your navbar where are your href’s pointing to?

is on the right track. You’re taking the ID of the section you want to look at. You’re just missing one part. To look at the ID of something what needs to go before it? It’ll be similar to how you reference the ID in a stylesheet.
Once you get this try and repeat this for Step 1, etc…

Also just another small formatting thing, maybe look to move your navbar to the top of the page with your stylesheet link.

Hope this helps!

You need to add href value, same as yours section id with a # before id name in your anchor opening tag.
Example

<section id="Hello_world">
<a href="#Hello_world">

Remember that you id and href value have same letters, means uppercase lowercase and spelling.
@beloved1480

It works but it still says my code is incorrect.

Please post your updated code so the forum can assist.

<a class="nav-link" href="Making_Code">Making Code</a>
<a class="nav-link" href="#Step 1">Step 1</a>
<a class="nav-link" href="#Step 2">Step 2</a>
<a class="nav-link" href="#Step 3">Step 3</a>
<a class="nav-link" href="#Step 4">Step 4</a>
<a class="nav-link" href="Making_Code">Making Code</a>
<a class="nav-link" href="#Step_1">Step 1</a>
<a class="nav-link" href="#Step_2">Step 2</a>
<a class="nav-link" href="#Step_3">Step 3</a>
<a class="nav-link" href="#Step_4">Step 4</a>

Hi @beloved1480

The href property value needs to start with a #

Happy coding

1 Like

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