rpatt
October 28, 2020, 3:14am
1
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
https://codepen.io/richpatt12/pen/VwjpaYZ
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:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
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
rpatt
October 28, 2020, 3:23am
4
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.
rpatt
October 28, 2020, 3:25am
5
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