Learn HTML by Building a Cat Photo App - Step 14

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

Hi All, I’m struggling to get this to work I’m trying to add a _blank to my anchor.

Your code so far

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <h2>Cat Photos</h2>
      <!-- TODO: Add link to cat photos -->

<!-- User Editable Region -->

      <p>See more <a _blank href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>

<!-- User Editable Region -->

      <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 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36

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

Link to the challenge:


q

Hi!
So, earlier in the lessons you added a href attribute with a value of https://freecatphotoapp.com to the anchor element.

When you write an attribute and value you structure it like this:

<element attribute="value"></element>

So using that same structure, how would you write a target attribute with a value of _blank?

1 Like
  <p>See more <a href= _blank"https://freecatphotoapp.com">cat photos</a> in our gallery.</p>

From what I understand it’s placement should be inside the a anchor element.forgive my ignorance this is the first ever piece of coding I have ever looked at .

Hi, in future, press the button with the left pointing arrow saying reply if you want to reply to my comment. Then I will get notified that you have replied.

Yes, the target attribute with the value of _blank needs to be inside the anchor element. However, it should not be inside the href attributes value.

Perhaps this example will help more:

<element attribute="value" attribute2="value2"></element>

You can have more than one attribute and value per element. The above is how it is structured.

3 Likes

Hello!
I noticed the target attribute is missing , along with the value of _blank. These should be placed either before the href, or anywhere within the anchor where the attribute/value combination do not interfere with any other attribute/value combinations.
This step has confused many, including me, so do not feel to badly about it.
Happy coding!

1 Like

Sorry I have been away with work. I now have my laptop again and have solved the issue and understand the problem i was facing. I don’t think it was helping i was using my phone !

Thank you for your help

1 Like

You are very welcome!
Happy coding! :slight_smile: