Id attribute element

Tell us what’s happening:

Your code so far


<h2>CatPhotoApp</h2>
<main>

<a href="#footer">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">Jump to Bottom</id> <footer>Copyright Cat Photo App</footer>

Your browser information:

User Agent is: Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 EdgiOS/44.4.0 Mobile/15E148 Safari/605.1.15.

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

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

You did not ask a question, so we do not know what help you need.

If the footer element has an Id attribute then how does it work?

It would work the same as adding an id attribute to any other element.

You have corectly changed the anchor element to link to an element with id=“footer”. The problem is, you have not updated the actual footer element to include an id attribute with value of “footer”. Instead, you attempted to add an id element (<id>....</id>) but there is no such element.

Would that mean the element itself has to be broken to contain the id attribute?

What do you mean by “broken”?

Changed from its original element

That is the only way to add the id attribute (or any attribute for that matter) to an element. Attributes go inside the element’s opening tag. For example:

<h1 id="hl-element">This is an H1 element</h1>

7 posts were split to a new topic: What does it mean to nest one element in another element