Technical Documentation Page - Build a Technical Documentation Page

Tell us what’s happening:
Step 13 -Each nav-link should have an href attribute that links to its corresponding main-section- What can I do to finally get this part check marked?
Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta http-equv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styles.css">
    <title>Java Documentation</title>
    </head>
    <body>
      <nav id="navbar">
      <header>Java Documentation</header>
      <ul id="ul-navbar">
        <li>
          <a class="nav-link" href="#Getting_Started_With_Java">Getting Started with Java</a>
          </li>
        <li>
          <a class="nav-link" href="#Java_Entry_Point">Java Entry Point</a>
          </li>
        <li>
          <a class="nav-link" href="#Printing_to_the_ Console">Printing to the Console</a>
          
          </li>
        <li><a class="nav-link" href="#Declaring_ Functions">Declaring Functions</a>
        </li>
        <li>
          <a class="nav-link" href="#Object_Oriented_ Programming">Object Oriented Programming</a>
          </li>
        </ul>
      </nav>
<main id="main-doc">
  <section class="main-section" id="Getting_Started_With_Java">
    <header>Getting Started with Java</header>
    <p>Steps in getting started</p>
    <ol>
      <li>Download Java</li>
      <li>Download Java SDK</li>
      <li>Get an Intergrated Development Enviroment (IDE)</li>
      <li>Start a project within IDE</li>
      <li>Code up "Hello World" and run the code</li>
      </ol>
    </section>
    <section class="main-section" id="Java_Entry_Point">
    <header>Java Entry Point</header>
    <p>The entry point to a java application is the main fucntion 
    </p>
    <pre>
      <code>
        public class MyMainFunction {
          /* Java main function example */
          public static void main (string[] args) {
          }
        }
        </code>
        </pre>
        <p>As you can see the main function is wrapped within a class which is part of the object oriented structure of Java Projects</p>
        <p>The name of the project is therefore "MyMainFunction"</p>
    </section>
    <section class="main-section" id="Printing_to_the_Console">
    <header>Printing to the Console</header>
    <p>In order to print the console. We use system.out.printIn.</p>
    <pre>
      <code>
        public class MyMainFunction {
          /* Java main function example */
          public static void main (string[] args) {
            System.out.printIn("Hello World");
          }
        }
        </code>
      </pre>
      <p>In this example we are printing out "Hello World" to the console when we run the program.
    </section>
    <section class="main-section" id="Declaring_Functions">
    <header>Declaring Functions</header>
    <p>Functions are actually called methods in Java.</p>
    <pre>
      <code>
        Public static void MyFunction (string name, int age)
        {
          // function code
        }
        </code>
      </pre>
    </section>
    <section class="main-section" id="Object_Oriented_Programing">
    <header>Object Oriented Programing</header>
    <p>Java is known as an object oriented programming language</p>
    <p>This means it is easy to represent enitites as objects by using classes and encapolation</p>
    <p>Here's an example</p>
    <pre>
      <code>
        public class student {
          /* student properites */
          private string name;
          private int age;
          /* Constructor */
          public student(string name, int age){
            this.name=name;
            this.age=age
          }
          /* Getter Method */
          public string getName(){
            return name;
          }
          /* Setter Method */
          public void setName(string name) {
            this.name=name;
          }
        </code>
      </pre>
      <p>We use this class by doing the following.</p>
      <pre>
        <code>
          Student student1 = new Student("David", 23);
          String davidname = student.getName();
          student1 setName("James");
          string jamesName = student.getName();
          </code>
        </pre>
    </section>
  </main>
      </body>
  </html>

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS aarch64 15278.64.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36

Challenge: Technical Documentation Page - Build a Technical Documentation Page

Link to the challenge:

Well, on the preview output from your page, try clicking all the links at the top… do they all function correctly?

I found the bottom three links didn’t take me to the appropriate section. So obviously there is something wrong with-in those links. See if you can find it. It was actually hard to find because of where the line-breaks are in the standard layout… If you close the instruction section(by clicking Instructions header as indicated below) that might help.

image

Let us know if you need help finding it.

I corrected the links, however it still says there’s an error every time run a test.

So you found the space in the name of the links??? OK… can you post your updated code so we can review for further issues?

OK, so I played with your original code, and the extra spaces weren’t the only issue with your links. After correcting the spaces I also found a spelling mistake in the word programming in several places. After that, seems those nav-link related tests now pass… you still need the media query.

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