Product Landing Page - Build a Product Landing Page

Tell us what’s happening:
I can’t find the solution even though the links work, it keeps coming out

Each .nav-link element should have an href attribute.
Failed: 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).
If someone can give me a clue what I’m doing wrong thanks in advance

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport"/> 
    <title>Product landing</title>
    <link rel="stylesheet" href="styles.css" />
      </head>
<body>
  <header id="header">
  <img id="header-img" src="https://cdn.freecodecamp.org/testable-projects-fcc/images/product-landing-page-logo.png">
  <nav  id="nav-bar">
    <ul>
        <li><a class="nav-link" href="#features">Features</a></li>
        <li><a class="nav-link" href="#how-it-works">How It Works</a></li>
        <li><a class="nav-link" href="#pricing">Pricing</a></li>
      </ul>
    </nav>
  </nav>
  </header>
  <div>
  <form id="form" method="post" action="https://www.freecodecamp.com/email-submit">
  <label for="email">Email:</label>
  <input type="email" name="email" id="email" placeholder="email"/>
   <input id="submit" type="submit" value="Submit" />
   </div>
   <div class="container">
        <section id="features">
 <ul>
   <h4 class="list-subtitle">Premium Materials</h4>
  <p>Our trombones use the shiniest brass which is sourced locally. This will increase the longevity of your purchase.</p>
   <h4 class="list-subtitle">Fast Shipping</h4>
  <p>We make sure you recieve your trombone as soon as we have finished making it. We also provide free returns if you are not satisfied.</p>
   <h4 class="list-subtitle">Quality Assurance</h4>
  <p>For every purchase you make, we will ensure there are no damages or faults and we will check and test the pitch of your instrument.</p>
 </ul>
 </div>
   </section>
    <div class="container">
 <section id="how-it-works">

 <iframe id="video" src="https://youtu.be/y8Yv4pnO7qc" height="300" width="400" name="demo">
 </iframe>
 </div>
   </section>
    <div class="container">
  <section id="pricing">
 
 <div class="level">TENOR TROMBONE</div>
 <h2>$600</h2>
  <ol>
     <li>Lorem Ipsum.</li>
     <li>Lorem Ipsum.</li>
     <li>Lorem Ipsum.</li>
     <li>Lorem Ipsum.</li>
   </ol>
    <button type="submit">Select</button>
 <div class="level">BAST TROMBONE</div>
 <h2>$900</h2>
  <ol>
     <li>Lorem Ipsum.</li>
     <li>Lorem Ipsum.</li>
     <li>Lorem Ipsum.</li>
     <li>Lorem Ipsum.</li>
   </ol>
   <button type="submit">Select</button>
 <div class="level">VALVE TROMBONE</div>
 <h2>$1200</h2>
  <ol>
     <li>Lorem Ipsum.</li>
     <li>Lorem Ipsum.</li>
     <li>Lorem Ipsum.</li>
     <li>Lorem Ipsum.</li>
     <button type="submit">Select</button>
   </ol>
   </div>
   </section>
   <footer id="footer">
      <ul>
 <li class="nav-link"><a href="">Privacy</a></li>
 <li class="nav-link"><a href="">Terms</a></li>
 <li class="nav-link"><a href="">Contact</a></li>
 <p>Copyright 2016, Original Trombones.</p>
    </ul>
   </footer>
</body>
/* file: styles.css */

Your browser information:

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

Challenge: Product Landing Page - Build a Product Landing Page

Link to the challenge:

Your li shouldnt have the class nav-link because they do not have a href

You need to remove that class from anything that does not have an href. Meaning none of your list items should have that class

1 Like

I have the class in <a , should I move it?

does your a have an href?

The error says

Each .nav-link element should have an href attribute.

anything that does not have an href should not have this class

they are written like this

  • Features
  • and when I test the links they work

    Removing that class from the li should have fixed both of those errors