I dont understand what an anchor element is

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**
    <h2>Cat Photos</h2>
    <!-- TODO: Add link to cat photos -->
    <p>Click here to view more <a href="">cat photos.</p>
    <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
  **Your browser information:**

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

Challenge: Step 12

Link to the challenge:

An anchor is a link. You use them all the time. You know when you’re on wikipedia and you are reading about Prussia and it mentions the “House of Hohenzollern” and you don’t know what that is, but you see that the text is blue and when click on it it navigates the browser takes you to that page? That is an anchor. It is another word for a link (more or less).

When I inspect the source code for that page in the browser dev tools, I see this:

<a href="/wiki/House_of_Hohenzollern" title="House of Hohenzollern">House of Hohenzollern</a>

That is the basic format of and anchor. We don’t need the title attribute, so we have this:

<a href="www.url-that-we-want.com">The text to show on the screen.</a>

For example, if I wanted a link to FCC, I could do:

Would you like to visit <a href="https://www.freecodecamp.org/learn">the FCC curriculum</a>?

That would render on the screen as:

Would you like to visit the FCC curriculum?

Does that make sense?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.