Technical Documentation Page - Build a Technical Documentation Page

Tell us what’s happening:
Describe your issue in detail here.
Please Help. i have an error " Your #navbar should have exactly one header element within it." only. I don’t understand how to solve this. Thank you for your help

Your code so far

<!-- file: index.html -->
<!doctype html>
<html>
  <head>
    <title></title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <main id="main-doc"> 
      <section id="Introduction" class="main-section">
        <header>Introduction</header>
        <p>JavaScript is a cross-platform, object-oriented scripting language. It is a small and lightweight language. Inside a host environment (for example, a web browser), JavaScript can be connected to the objects of its environment to provide programmatic control over them.</p>
        <p>JavaScript contains a standard library of objects, such as Array, Date, and Math, and a core set of language elements such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objects; for example:</p>
        <ul>
          <li>Client-side JavaScript extends the core language by supplying objects to control a browser and its Document Object Model (DOM). For example, client-side extensions allow an application to place elements on an HTML form and respond to user events such as mouse clicks, form input, and page navigation.</li>
          <li>Server-side JavaScript extends the core language by supplying objects relevant to running JavaScript on a server. For example, server-side extensions allow an application to communicate with a database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server.</li>
        </ul>
        <code></code>
        <p></p>
        <code></code>
        <p></p>
        <p></p>
        <code></code>
        <p></p>
        <p></p>
        <code></code>
        <p></p>
        <p></p>
        <code></code>
      </section>
      <section id="What_you_should_already_know" class="main-section">
        <header>What you should already know</header>
        <p>This guide assumes you have the following basic background:</p>
        <ul>
          <li>A general understanding of the Internet and the World Wide Web (WWW).</li>
          <li>Good working knowledge of HyperText Markup Language (HTML).</li>
          <li>Some programming experience. If you are new to programming, try one of the tutorials linked on the main page about JavaScript.</li>
        </ul>
      </section>
      <section id="JavaScript_and_Java" class="main-section">
        <header>JavaScript and Java</header>
      </section>
      <section id="Hello_World" class="main-section">
        <header>Hello World</header>
      </section>
      <section id="Variables" class="main-section">
        <header>Variables</header>
      </section>
    </main>
    <nav id="navbar">
      <header>Introduction</header>
      <a class="nav-link" href="#Introduction">Introduction</a>
    </nav>
    <nav id="navbar">
      <header>What you should already know</header>
      <a class="nav-link" href="#What_you_should_already_know">What you should already know</a>
    </nav>
    <nav id="navbar">
      <header>JavaScript and Java</header>
      <a class="nav-link" href="#JavaScript_and_Java">JavaScript and Java</a>
    </nav>
    <nav id="navbar">
      <header>Hello World</header>
      <a class="nav-link" href="#Hello_World">Hello World</a>
    </nav>
    <nav id="navbar">
      <header>Variables</header>
      <a class="nav-link" href="#Variables">Variables</a>
    </nav>
  </body>
</html>
/* file: styles.css */
nav{
  position: absolute;
  color: rgb(20, 20, 100)
}
@media (max-width: 120px){
  .h1{
    color: black;
  }
  .navbar{
    float: left;
  }
}

Your browser information:

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

Challenge: Technical Documentation Page - Build a Technical Documentation Page

Link to the challenge:

Hi there and welcome to the forum!

Firstly, I’d put your navbar code at the top of your body (just above the main opening tag), above all of your section elements.

Secondly, you should only have one nav element (and id attributes must always be unique, so you couldn’t have several id="navbar" attributes in your code anyhow).
All of your .nav-link elements should be contained within a single nav element, with a single header.

The structure for a navbar should be something like:

<nav id="navbar">
  <header>Header Title</header>
  <a class="nav-link" href="#Section_name">Link text</a>
  ...
  <a class="nav-link" href="#Section_name">Link text</a>
</nav>

You can also help with formatting of your navbar by putting all of the .nav-link elements inside li elements, inside an ul if you need to.

1 Like

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