Each .nav-link should have an href attribute that links

I don’t know why this error is showing though i code according to it .
https://www.freecodecamp.org/learn/responsive-web-design/responsive-web-design-projects/build-a-technical-documentation-page

please post your code, without it it is impossible to debug

Thanks for your reply, but I already posted my code.

where, sorry? there is no code in your first post

there is written

Sorry ,now i think my code is showing .
I’ll be glad if you help me.

still no, please paste your code in a new post

oops …I don’t know why it’s not showing but I already Posted it.

No, please, copy the code from the editor and paste it here in a post

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 (’).

Thanks for your help ,I think Now you can see it.

I don’t know what’s the problem here although I did according to it.

Can you please tell me where you’re having trouble with this?

The third last test , nav link one.

Can I see your code for the navbar element?

1 Like

https://www.freecodecamp.org/learn/responsive-web-design/responsive-web-design-projects/build-a-technical-documentation-page

You can see it from here

But can I see the code you wrote?

<nav id="navbar" class="large_menu" >
<header id="head">PYTHON</header>
<ul id="ul">
<li id="ll"><a class="nav-link" href="#Introduction">Introduction</a></li>
<li id="ll"><a class="nav-link" href="#Python_Syntax">Python Syntax</a></li>
<li id="ll"><a class="nav-link" href="#Variables">Variables</a></li>
<li id="ll"><a class="nav-link" href="#Python_Data_Types">Python Data Types</a></li>
<li id="ll"><a class="nav-link" href="#Python_Strings">Python Strings</a></li>
<li id="ll"><a class="nav-link" href="#Python_Lists">Python Lists</a></li>
<li id="ll"><a class="nav-link" href="#Python_if_else ">Python if else</a></li>
<li id="ll"><a class="nav-link" href="#Python_While_Loops">Python While Loops</a></li>
</ul>
</nav>

Well, I think the problem is in your <main> section. I’m not sure, but I think you should check/rewrite the id for each .main-section element, it might work.

I did but it still showing this problem ;-;

if you show all your code maybe we can help

<style>
  #string{
    font-color:red;
  }
    #navbar a {
        margin-top: 10px;
    }
    #main-doc header {
      font-weight:bold;
      text-decoration: underline;
    font-size: 1.5rem;
    font-weight: 500;
}
#main-doc {
    width: 100%;
}
#navbar a {
    display: block;
    padding: 0px 0px;
    color:white;
    text-decoration: none;
    cursor: pointer;
    position:relative;
    margin-left:1px;
    
}
#navbar a:hover{
  color:yellow;
}
 #navbar li {
    color: #4d4e53;
    list-style: none;
 
}
@media screen and (min-height: 480px)
 {
   body{
     background-color:black;
     color:white;
   }
 }
 #head{
   font-weight:bold;
   text-decoration:underline;
 }
 #ll {
    text-align: -webkit-match-parent;
}
#ul {
    list-style-type: none;
}
  
</style>
<body>
<nav id="navbar" class="large_menu" >
<header id="head">PYTHON</header>
<ul id="ul">
<li id="ll"><a class="nav-link" href="#Introduction">Introduction</a></li>
<li id="ll"><a class="nav-link" href="#Python_Syntax">Python Syntax</a></li>
<li id="ll"><a class="nav-link" href="#Variables">Variables</a></li>
<li id="ll"><a class="nav-link" href="#Python_Data_Types">Python Data Types</a></li>
<li id="ll"><a class="nav-link" href="#Python_Strings">Python Strings</a></li>
<li id="ll"><a class="nav-link" href="#Python_Lists">Python Lists</a></li>
<li id="ll"><a class="nav-link" href="#Python_if_else ">Python if else</a></li>
<li id="ll"><a class="nav-link" href="#Python_While_Loops">Python While Loops</a></li>
</ul>
</nav>
<br>
<hr>
<main id="main-doc">
  <section id="Introduction"  class="main-section">
    <header>Introduction</header>
    <h3>What is Python</h3>
    <p>Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.</p>
    <p>It is used for :</p>
    <ul>
      <li>Web Development</li>
      <li>Software Development</li>
      <li>Mathematics</li>
      <li>System Scripting</li>
    </ul>
    <h3>What can Python do?</h3>
    <ul>
      <li>Python can be used on a server to create web applications.</li>
      <li>Python can be used alongside software to create workflows.</li>
      <li>Python can connect to database systems. It can also read and modify files.</li>
      <li>Python can be used to handle big data and perform complex mathematics.</li>
      <li>Python can be used for rapid prototyping, or for production-ready software development.</li>
    </ul>
</section>
<section id="Python_Syntax"  class="main-section">
  <header>Python Syntax</header>
  <h5>Syntax</h5>
  <pre>
  <code>
    >>>print("hello world")
    hello world
  </code>
  </pre>
  <h5>Python Indentation</h5>
  <p>Indentation refers to the spaces at the beginning of a code line.
<br>
Where in other programming languages the indentation in code is for readability only, the indentation in Python is very important.
<br>
Python uses indentation to indicate a block of code.</p>
<pre>
<code>
  if 5>2:
     print("Five is greater than 2")
</code>
</pre>
<p>Python will give error if we skip the indentation.</p>
<h5>Comments</h5>
<p>Python has commenting capability for the purpose of in-code documentation.<br>
  Comments start with a # , and python will render the rest of the line as a comment.
  <pre>
  <code>
    <font color = "green ">#This is a comment.</font>
    print("Hello world!")
  </code>
  </pre>
</p>
</section>
<section id="Variables" class="main-section">
  <header>Variables</header>
  <h5>Creating Variables</h5>
  <p>Python has no command for declaring a variable.
<br>
  A variable is created a moment you firsr assign a value to it.
  </p>
  <pre>
    <code>
      x=5
      y-"john"
      print(x)
      print(y)
    </code>
  </pre>
  <h5>Variables Name</h5>
  <p>A variable can have a short name (like x and y) or a more descriptive name (age, carname, total_volume). Rules for Python variables:</p>
  <ul>
    <li>A variable name must start with a letter or the underscore character</li>
    <li>A variable name cannot start with a number</li>
    <li>A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )</li>
    <li>Variable names are case-sensitive (age, Age and AGE are three different variables)</li>
  </ul>
  <pre>
    <code>
      name = "John"
      my_name = "John"
      _my_name = "John"
      myName = "John"
      MYNAME = "John"
      myname2 = "John"
    </code>
  </pre>
</section>
<section id="Python_Data_Types" class="main-section">
  <header>Python Data Types</header>
  <h5>Built-in Data Types</h5>
  <p>In programming, data type is an important concept.
<br>
Variables can store data of different types, and different types can do different things.
<br>
Python has the following data types built-in by default, in these categories:</p>
<table class="w3-table">
  <tbody><tr>
    <td style="width:160px;">Text Type:</td>
    <td style="color:red"><code class="DataTypes">str</code></td>
  </tr>
  <tr>
    <td>Numeric Types:</td>
    <td style="color:red"><code class="DataTypes">int</code>, <code class="DataTypes">float</code>,
    <code class="DataTypes">complex</code></td>
  </tr>
  <tr>
    <td>Sequence Types:</td>
    <td style="color:red"><code class="DataTypes">list</code>, <code class="DataTypes">tuple</code>, 
    <code class="DataTypes">range</code></td>
  </tr>
  <tr>
    <td>Mapping Type:</td>
    <td style="color:red"><code class="DataTypes">dict</code></td>
  </tr>
  <tr>
    <td>Set Types:</td>
    <td style="color:red"><code class="DataTypes">set</code>, <code class="DataTypes">frozenset</code></td>
  </tr>
  <tr>
    <td>Boolean Type:</td>
    <td><code class="DataTypes" style="color:red">bool</code></td>
  </tr>
  <tr>
    <td>Binary Types:</td>
    <td style="color:red"><code class="DataTypes">bytes</code>, <code class="DataTypes">bytearray</code>, 
    <code class="DataTypes">memoryview</code></td>
  </tr>
  <tr>
    <td>None Type:</td>
    <td><code class="DataTypes" style="color:red">NoneType</code></td>
  </tr>
</tbody></table>
</section>
<br>
<section id="Python_Strings" class="main-section">
  <header>Python Strings</header>
  <h5>Strings</h5>
  Strings in python are surrounded by either single quotation marks, or double quotation marks.

<code id="string" style="color:red">'hello'</code> is the same as <code id="string" style="color:red"> "hello".</code>

You can display a string literal with the print() function:
<pre>
  <code>
    print('Hello')
    print("Hello")
  </code>
</pre>
</section>
<section id="Python_Lists" class="main-section">
  <header>Python Lists</header>
  <h5>List</h5>
  <p>Lists are used to store multiple items in a single variable.
<br>
Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage.
<br>
Lists are created using square brackets:</p>
<pre>
  <code>
    list=[ <font color=brown>"apple" , "banana", "cherry"</font>]
    print(list)
  </code>
</pre>
</section>
<section id="Python_if_else" class="main-section">
  <header>Python if else</header>
  <p>
    Python supports the usual logical conditions from mathematics:

Equals: <code style="color:red">a==b</code><br>
Not Equals: <code style="color:red"> a != b</code><br>
Less than: <code style="color:red">a < b</code><br>
Less than or equal to:<code style="color:red"> a <= b</code><br>
Greater than:<code style="color:red"> a > b</code><br>
Greater than or equal to: <code style="color:red">a >= b</code><br>
These conditions can be used in several ways, most commonly in "if statements" and loops.

An "if statement" is written by using the <code style="color:red">if</code> keyword.
  </p>
  <pre>
    <code>
      a =<font color=red>33</font>
      b =<font color=red>200</font>
      if b>a:
         print(" <font color=brown>b is greater than a" </font>)
    </code>
  </pre>
<p>Python relies on indentation (whitespace at the beginning of a line) to define scope in the code.So Indentation is important after every scope.
</p>
</section>
<section id="Python_While_Loops" class="main-section">
  <header>Python While Loops</header>
  <p>The while loop we can execute a set of statements as long as a condition is true.</p>
  <pre>
    <code>
      i=1
      while i<6:
        print(i)
        i+=1
</code>
  </pre>
</section>
</main>
</body>
1 Like