Product Landing Page nav-link error?

My page gets this error

" 5. When I click a .nav-link button in the nav element, I am taken to the corresponding section of the landing page.'

The .nav-link with href="#home" is not linked to a corresponding element on the page "

but they are and they are working. So what is wrong? Is it a bug?

Checked it with Chrome, Safari and Firefox.

Here’s the page Product Landing Page
And here’s the code Product Landing Page code

Looks like you’re missing a div with the id home.

No, that’s what makes it so weird. It’s there as well as the other id’s.

You have a link that points to #home, that’s right. But you don’t have a div with the id home.

Have you checked the code? It is there. How would the link have worked otherwise?

Oh wait, I see it now. My anchors have names instead of id’s.

I’ve made a pull request, check if it fix your code. It works because when you have an internal link that points to something invalid it goes to the top. Coincidently, it is exactly where you want it to go. :smiley:

Hahaha, the links refer to the anchor names. It works, but it’s not what is asked for. They want ID’s (way too many id’s :stuck_out_tongue_closed_eyes:)

And thanks! :+1:t2:

Yes, internal links searches for id’s. So, the tests passed now?

Yes, it does. But they also search for name-tags.

I don’t think they search for name, only for ids. Anyway, glad the tests are passing now.

1 Like

I proved it also search for anchor names, the links worked when they were named. Didn’t you try them all?

Anyway, glad you got me on the right track. Thanks again. :blush:

Ok so I did some tests and it does work when you use <a name="something"></a>, but it does not work if you put the attribute name anywhere else.

It works only with chrome, firefox did not work. Not sure about other browsers too.

Anyway, how you discover that? :smiley: Don’t use this way, put the id attribute, it’s the correct and supported way .

I tested it in Firefox, chrome and safari om my Mac, they all worked.
Dunno, I just tried it, I guess. Won’t do that anymore, promise. :grinning:

1 Like