- When I click a .nav-link button in the nav element, I am taken to the corresponding section of the landing page.’
This is the error I keep getting on my site and I’m not sure why. My links that I have created take me to a different spot on my page but the test doesn’t give me credit for it. Please help. here is a link to the page.
when you look at the error you see this detail:
AssertionError: Each .nav-link element should have an href attribute : expected false to equal true
So based on this, I looked at one of your .nav-link elements and I found this
<li class="nav-link"><a href="#bottom-list">All Games</a></li>
The ‘nav-link’ element is the ‘li’ element. And it does not have an href…
So you see the problem?
your href are listed:
and the id’s on the list later are:
Just fix this and you should be fine!
I changed #bottom-list to #bottom-li3 and the links work fine, it just wont pass it as complete
Thank you for your reply. I think you are saying that if I give my anchor tag a "class=“nav-link” it would fix the problem? I did this and it didn’t seem to solve my problem. so maybe I don’t see the problem.lol
Do you have a link to your updated code?
I clicked the codepen link above but it still shows the incorrect lines.
ps. you’ve already marked someone’s answer above as the solution, so are you sure you still need help?
I redid what i think you were asking me to do. You should be able to see it now, i changed it back earlier because it didn’t fix my problem. I may not be understanding what you trying to convey. and no i didn’t mean to click the solved checkbox
Hi again, here’s what I see
<li> <a class="nav-link" href="#bottom-li3">All Games</a></li> <li class="nav-link"><a href="#bottom-li2">Ages 5 - 13</a></li> <li class="nav-link"><a href="#bottom-li1">Ages 14 and up</a></li>
You should fix all the lines so that each nav-link element has an href (so you still have two more to go).
That did it! I thought if i only did one it would meet the requirements and it did not, once i did all of them as you suggested it worked! Thanks so much!!!
no problem. Hopefully for the next assertion error you see, you will be able to identify the issue by reading the error description and identifying the related tags that need to be fixed to pass the test.