Having trouble linking to a section on page

Tell us what’s happening:
I’m having trouble making my nav links link to a certain section on my page.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36.

Challenge: Build a Product Landing Page

Link to the challenge:

1 Like

I think this is because you dont have enough content on the page to have that scroll effect.

Hey @rpatt!

For test No.5, you need to move the class of nav link to the anchor tag like this.

<a class="nav-link" href="#How-Its-Made">How it's Made</a>

You will also need to delete the class of nav link in that div element you created.

<div class="nav-link"> <!--delete this class-->

Hope that helps!

1 Like

I don’t think it’s that because I opened the browser and when I clicked the links it went to that section but the “Fork Me” on cedepen is saying it doesn’t work for some reason.

Oh ok I see this worked. Does the class link always have to be in the tags instead of the list items tags?

Yes the class of nav link needs to be in the anchor tag instead of the li tag because that anchor tag is taking us to another section on the page. The li tag just represents a list item.

1 Like