Learn HTML by Building a Cat Photo App - Step 14

Tell us what’s happening:
Can someone help me understand what a “target” attribute does and what the purpose of the _blank is??

Your code so far

<html>
  <body>
    <h1>CatPhotoApp</h1>
    <main>
      <h2>Cat Photos</h2>
      <!-- TODO: Add link to cat photos -->
      <p>Click here to view more <a href="https://freecatphotoapp.com">cat photos</a>.</p>
      <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
    </main>
  </body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14989.107.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Challenge: Learn HTML by Building a Cat Photo App - Step 14

Link to the challenge:

Target tells the browser where the new website should be shown.
If you click on the link the webpage can
Be shown in the same tab or a new tab for eg or a whole new window.

_blank means you want it to the new page to be opened right here (same place you are in when you clicked)

Ok, so how do I code this

Look at how you wrote the href attribute.

target is the same but it is called target and has a different value “_blank”

Thanks so much! Happy Coding!

1 Like