Link to Internal Sections of a Page with Anchor Elements (Quite complicated for beginners :( )

Tell us what’s happening:

Your code so far


<h2>CatPhotoApp</h2>
<main>
  
  <a href="#http://freecatphotoapp.com"">Jump to Bottom</a>
  
  <img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
  
  <p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
  <p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
  <p>Meowwww loved it, hated it, loved it, hated it yet spill litter box, scratch at owner, destroy all furniture, especially couch or lay on arms while you're using the keyboard. Missing until dinner time toy mouse squeak roll over. With tail in the air lounge in doorway. Man running from cops stops to pet cats, goes to jail.</p>
  <p>Intently stare at the same spot poop in the plant pot but kitten is playing with dead mouse. Get video posted to internet for chasing red dot leave fur on owners clothes meow to be let out and mesmerizing birds leave fur on owners clothes or favor packaging over toy so purr for no reason. Meow to be let out play time intently sniff hand run outside as soon as door open yet destroy couch.</p>
  
</main>
  
<id footer>Copyright Cat Photo App</footer>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/link-to-internal-sections-of-a-page-with-anchor-elements/

ok, so…

for an anchor link, you need the href to point to an attribute (like the id) of another tag.

in this case, we want the anchor link to point to the footer

so start with this (i have removed the url and the extra quotation marks from your link tag):

<a href="#">Jump to Bottom</a>

then look at the footer tag, you have:

<id footer>Copyright Cat Photo App</footer>

the id attribute isn’t set to anything, you need to give it a value, like this:

<footer id="footer">Copyright Cat Photo App</footer>

now, go back to your link tag, and add the id like this:

<a href="#footer">Jump to Bottom</a>

the # in the href means we’re staying on the same page, just scrolling to another section of the page. the text after the # is the id value of whatever element you want to scroll to.

hope that helps.

1 Like