I can't link to internal sections of a pafge with anchor elements

Tell us what’s happening:

Your code so far


8<h2>CatPhotoApp</h2>
<main>

<a href="https://freecatphotoapp.com" target="_blank">cat photos</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>
#footer<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 refooterMeow to be let out play time intefooterniff hand run outsfooter soon as door open yet destroy co#footer>

</main>

<a href="#footer"> jump bottom </a>
<h3 id="value of footer"> footer </h3>

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 8.1.0; CPH1909 Build/O11019) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36.

Challenge: Link to Internal Sections of a Page with Anchor Elements

Link to the challenge:

1 Like

Hello @Kiruni good evening from Mexico. Assuming the code that you posted is the actual code used in the challenge then , let me try and help with the following:

  1. Your <a></a> tags are set correctly to link to the element with id=“footer”
  1. Make sure you give the footer the correct id value and things will work, as the href in the <a></a> element will reference the element with the specified id.

And remember you can always reset the challenge, to start over if you get lost.

Hope this helps you :blush:

1 Like

Hey @Kiruni. Welcome to the forums. The answer of @palmaone is correct, but there are more issues in your code:

  • The challenge says you to EDIT the existing <a></a> element. But, you created a new <a> element, which is unnecessary. So, I would suggest you to reset your code and do as following:

    1. Do you see an existing <footer> element? Add an id attribute to it with the value of footer.
    2. Now edit the EXISTING <a> element’s href value to #footer.
    3. Remove the target=_blank from the EXISTING <a> element.
    4. Edit the text of EXISTING <a> element’s text from “cat photos” to “Jump to Bottom”.

Now you will pass the test. If you don’t understand this challenge, I will explain it:

  • This challenge is about creating a link that allows you to navigate to internal sections of your webpage rather than external links.
  • To create an internal link, you need to add an id attribute to the desired element you want the anchor tag to link to.
  • After creating the id , you need to assign the value of your anchor tag’s href attribute to #idname where idname represents the id of the element you are linking to.
  • Now you will have a working internal link

Hope this helps

1 Like