Topzie
October 23, 2018, 8:29pm
1
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
.
Topzie
October 23, 2018, 8:37pm
3
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
.
Topzie
October 23, 2018, 8:42pm
5
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.
Topzie
October 23, 2018, 8:46pm
7
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 )
And thanks!
Yes, internal links searches for id’s. So, the tests passed now?
Topzie
October 23, 2018, 8:48pm
9
Yes, it does. But they also search for name-tags.
ghukahr
October 23, 2018, 8:50pm
10
I don’t think they search for name, only for ids. Anyway, glad the tests are passing now.
1 Like
Topzie
October 23, 2018, 8:52pm
11
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.
ghukahr
October 23, 2018, 8:59pm
12
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? Don’t use this way, put the id
attribute, it’s the correct and supported way .
Topzie
October 23, 2018, 9:02pm
13
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.
1 Like