Technical Documentation Page - Build a Technical Documentation Page

Tell us what’s happening:

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.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

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

Challenge: Technical Documentation Page - Build a Technical Documentation Page

Link to the challenge:

Welcome to our community!

I’ve edited your code for readability. 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 (').

<nav id="navbar">
			<header>Documentation Menu</header>
			<a href="#What_is_Java?" class="nav-link">
				What is Java?</a>
			<a href=" #Object_and_classes" class="nav-link">
				Objects and Classes</a>
			<a href="#Inheritance" class="nav-link">
				Inheritance</a>
			<a href="#Polymorphism" class="nav-link">
				Polymorphism</a>
			<a href="#Abstraction" class="nav-link">
				Abstraction</a>
			<a href="#Encapsulation" class="nav-link">
				Encapsulation</a>
		</nav> 

This is code I wrote for navigation bar and I’m facing trouble for this context… 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).
please help me with this

I don’t see any .main-section element here. Post the entire html and css code.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta name="viewport" content="width=device-wdith,initial-scale=1.0">
    <title>Technical Documentation Page</title>
    <link rel="stylesheet" href="styles.css">
    </head>
    <body>
      <div class="main-body">
		<nav id="navbar">
			<header>Documentation Menu</header>
			<a href="#What_is_Java?" class="nav-link">
				What is Java?</a>
			<a href=" #Object_and_classes" class="nav-link">
				Objects and Classes</a>
			<a href="#Inheritance" class="nav-link">
				Inheritance</a>
			<a href="#Polymorphism" class="nav-link">
				Polymorphism</a>
			<a href="#Abstraction" class="nav-link">
				Abstraction</a>
			<a href="#Encapsulation" class="nav-link">
				Encapsulation</a>
		</nav> 

      <main id="main-doc">
        <section class="main-section" id="What_is_Java?">
          <header>What is Java?</header>
                     <p></p>
   </section>
            <section class="main-section" id="Objects_and_Classes">
              <header>Objects and Classes</header>
              <p></p>
            </section>
                <section class="main-section" id="Inheritance">
                  <header>Inheritance</header>
                  <p></p>
                </section>
                    <section class="main-section" id="Polymorphism">
                      <header>Polymorphism</header>
                      <p></p>
                    </section>
                        <section class="main-section" id="Abstraction">
                          <header>Abstraction</header>
                          <p></p>
                        </section>
                        <section class="main-section" id="Encapsulation">
                          <header>Encapsulation</header>
                          <p></p>
                       </section>
      </main>
      </div>
      </body>
  </html>

**This is skeleton of program I've written please help me and let me know where it went wrong**
  • <a href=" #Object_and_classes" class="nav-link">
  • <section class="main-section" id="Objects_and_Classes">

Check all of these pairs. The href has the text “Object…”, whereas the id has “Objects…”.

I’ve edited it …It’s showing the same error

Always post the code. Don’t explain the issue in words only.

<div class="main-body">
		<nav id="navbar">
			<header>Documentation Menu</header>
			<a href="#What_is_Java?" class="nav-link">
				What is Java?</a>
			<a href=" #Objects_and_Classes" class="nav-link">
				Objects and Classes</a>
			<a href="#Inheritance" class="nav-link">
				Inheritance</a>
			<a href="#Polymorphism" class="nav-link">
				Polymorphism</a>
			<a href="#Abstraction" class="nav-link">
				Abstraction</a>
			<a href="#Encapsulation" class="nav-link">
				Encapsulation</a>
		</nav> 

      <main id="main-doc">
        <section class="main-section" id="What_is_Java?">
          <header>What is Java?</header>
            <p></p>
        </section>
            <section class="main-section" id="Objects_and_Classes">
              <header>Objects and Classes</header>
              <p></p>
            </section>
                <section class="main-section" id="Inheritance">
                  <header>Inheritance</header>
             <p></p>
                </section>
                    <section class="main-section" id="Polymorphism">
                      <header>Polymorphism</header>
                      <p></p>
                    </section>
                        <section class="main-section" id="Abstraction">
                          <header>Abstraction</header>
                         <p></p>
                        </section>
                        <section class="main-section" id="Encapsulation">
                          <header>Encapsulation</header>
<p></p>
                           </section>
      </main>
      </div>
      </body>
  </html>

**Sorry for causing the trouble **

1 Like
<a href=" #Objects_and_Classes" class="nav-link">

Delete the blank space in front of the #Objects_and_Classes

2 Likes

Thanks For the help, I’m so thankful for you :smiley:
I got it right…Sorry for causing trouble

1 Like