Build a Product Landing Page - issue with .nav-link

Tell us what’s happening:

FCC assessment tool stating does not detect a href that links to a section of the page, the href is visibel together with the ids that link to that section of the page:

  1. When I click a .nav-link button in the nav element, I am taken to the corresponding section of the landing page.’
    Each .nav-link element should have an href attribute : expected false to equal true
    AssertionError: Each .nav-link element should have an href attribute : expected false to equal true
    at s.u (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:262:1134)
    at s.e.(anonymous function) [as equal] (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:325:126)
    at Function.n.strictEqual (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:224:568)
    at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:154:307158
    at NodeList.forEach ()
    at r. (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:154:307107)
    at c (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:159:31608)
    at o.f.run (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:159:31544)
    at m.runTest (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:159:37114)
    at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:159:37976

Your code so far

Product Landing Page | FreeCodeCamp
company logo Sporting S.P.R.L

Fitness with a twist

American Football

State of the Art football fields

You will not find high quality football stadiums than use at lowest prices available on the market

Swimming

Hygiene conscious small and large pools

Our specialised pool cleaners regularly clean our pools 2-3 times per week with certified chloride

Ice Skating

Every day like new

Our ice rinks are checked for holes and scratches fixed before opening time

Bronze

  • $20 Per Month
  • choice of 1 sport only
  • Accessible Monday to Friday
  • Daytime only
  • Non-priority queuing
  • Equipment fee $10 per item

Platinum

  • $50 Per Month
  • All 3 sports included
  • Accessible Monday to Friday
  • daytime afternoon and evening
  • priority queuing
  • Equipment at no additional cost

Gold

  • $35 Per Month
  • choice of 2 sport only
  • Accessible Monday to Friday.
  • Daytime and afternoon
  • Non-priority queuing
  • Equipment fee $7 per item
  • Disclaimer
  • FAQ
  • Help
© Copyright 2018 All rights reserved to Sporting S.P.R.L

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36.

Link to the challenge:

Can you share a link to a codepen?

Hi,

I don’t have a codepen for this project however here is the link from my webhost

here is my codepen

You need to give your anchors a class of nav-link not to the li like:

                  <li ><a class="nav-link" href="#title"> Home </a></li>
                  <li ><a class="nav-link" href="#tariff-container"> Tariff </a></li>
                  <li ><a class="nav-link" href="#contact"> Contact </a></li>
1 Like

Hi Sorinr,

Thanks i did what you suggested which is update also on my codepen however, the same message is returned from freecodecamp which i am not understanding why.

You are not closing the class name. Eg:

<li> <a class="nav-link href="#title"> Home </a></li>

All the links are similar. Properly close the class names and your tests will pass

3 Likes

thank you, that solved my problem