<nav> Problem, help!

13. When I click on a navbar element, the page should navigate to the corresponding section of the “main-doc” element (e.g. If I click on a “nav-link” element that contains the text “Hello world”, the page navigates to a element that has that id and contains the corresponding .

There’s more to the message than just that.
When a test fails click the red button to see which test(s) are failing and text to help you correct the issue.
Be sure and read more than just the first line of the failing message. The ability to read and comprehend error messages is a skill you’ll need to acquire as a developer. Ask questions on what you don’t understand.

Additionally, if you do have questions a link to your pen would be helpful so we can see what’s going on.

1 Like

Thank you, I fixed it.

Good to hear you were able to figure it out.

1 Like

Hello @khaldi,

Usually when an anchor doesn’t work it is because of the way the id are used. Check well your anchor, if you didn’t misspelled the id your anchor points at for example or maybe you forgot to use the sharp sign “#” somewhere. Check well in the freeCodeCamp class the syntax in the examples.

Example of correct syntax:

<a href="#my_main">Click here</a>
<main id="my_main">
1 Like

Hi! @LucLH
Thank you, I find the problem and I had fixed it, It was a stupid one, just a white space in the id attribute.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.