Landing Page Test Fail

Tell us what’s happening:
One of the tests keeps failing even though it does what it’s supposed to do.
The links of the nav-bar do take you to the section of the landing page but I don’t know why it keeps failing the test.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0.

Challenge: Build a Product Landing Page

Link to the challenge:

@msalas2199 Check your HOME Link looks like it is empty. As I look through the code I also don’t see a id of home anywhere. I think that is your problem. Once you get a home id and fix the link it should pass. Happy Coding! :smile:

        <li class="nav-link"><a href="#">HOME</a></li>
        <li class="nav-link"><a href="#About">ABOUT</a></li>
        <li class="nav-link"><a href="#Pricing">PRICING</a></li>
      <a href="#Contact"><button>BOOK NOW</button></a>

The elements with the class nav-link do not have href attributes.

1 Like

They have elements with href attributes but not the href attribute

The class="nav-link" should be on the nav links (anchor tags <a>) not the list items <li>.

The empty href="#" does not link to an element on the page so it will give you an error. You might try wrapping everything inside a element (body or whatever) and give it an id that you then set to match the href on the link (e.g. on body id="home", on link href="#home"). That should take you to the top of the page when clicked and still pass the test.