My code tester Not accepting my nav-link href

Tell us what’s happening:
I am creating a landing page in freecodecamp frontend course, It has a test that states:
Each .nav-link element should link to a corresponding element on the landing page (has an href with a value of another element’s id. e.g. #footer ).

I have nav-link in my code and they are refering to document sections, but my code is not passing this test .

Following is my code

Your code so far

<!DOCTYPE html>
<html lang="en">
  <title>Product Landing page</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<header id="header">
  <nav id="nav-bar" class="navbar navbar-expand-sm navbar-light bg-light">
  <a class="navbar-brand" href="#">
    <img id="header-img" src=""width="50" height="50" style="border-radius:50%; object-fit:cover;"/>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="flase" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
        <a class="nav-link" href="#Home">Home </a>
      <li class="nav-item">
        <a class="nav-link" href="#Products">Products</a>
      <li class="nav-item">
        <a class="nav-link" href="#AboutUs">About Us</a>
   <section id="Home"><h3>Home</h3>
   <section id="Products"><h3>Products</h3>
    <video id="video" width="100%" height="auto" controls>
  <source src="" type="video/mp4">
  Your browser does not support the video tag.
   <section id="AboutUS"><h3>About Us</h3></section>
<script src="" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>


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/103.0.5060.66 Safari/537.36

Challenge: Build a Product Landing Page

Link to the challenge:

Part of programming is debugging things that don’t work. Often it’s as simple as a little typo, which is the case here. I’m not going to tell you exactly where it is because that will take the joy out of finding your own bugs :slight_smile: I will tell you that it is definitely a problem with one of your nav links. It might be more apparent if you had more content on the page, then it would be easier to see that one of the links is not working.

1 Like

Thanx alot. And I really appreciate that you didnt tell me exactly about the error

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