Learn HTML by Building a Cat Photo App - Step 14 Im stuck please help

Add a target attribute with the value _blank to the anchor (a ) element’s opening tag, so that the link opens in a new tab.

 My Code:
  <p>Click here to view more <a href= _blank "https://freecatphotoapp.com">cat photos</a>.</p>
<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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.33

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

Link to the challenge:

You need to add the attribute called “target” to the opening tag of the anchor element (that is the one that starts with <a href)

Make sure you place the word in the tag then followed by an equal sign and followed by the “_blank” value in double quotes.

I still do not understand, I just started yesterday, and I am new to this.

okay, no worries.
Let me try a different explanation.

So far you know how to make an anchor tag right? and an img tag?
These both have attributes inside them. For eg. an anhor tag has the href attribute
and the img tag has the src attribute.

Hopefully so far so good? (ask if not)

Now you are learning about a new attribute called target.
So just like src and just like href you have to add it to the respective element.
In this case add the target attribute to the anchor tag (leave a single space between it and the other attribute href and then add it)
Don’t forget to give it a value, just like href has a value. (but the value in this case is “_target”)

Day 3 and I am still stuck. Why doesn’t it show you an example like all the other steps? I do not understand where the target is going in the (anchor) or if i have to make a new (anchor) inside of the original (anchor).

okay how about something different.
Try to restart the step.
(Click the button to restart)

Then I want you to add another href tag to the anchor (do not erase the one you have).
Just add another one next to it.
This time write it like this href=“_blank”

Then show me the latest code… (or, alternatively once you have added the 2nd href, just change the name ‘href’ to ‘target’ and check the solution)

<p>Click here to view more <a href= 'target'="blank""https://freecatphotoapp.com">cat photos</a>.</p>

This is the code that I wrote however, it’s still wrong

Click here to view more cat photos.

  <p>Click here to view more <a href= 'target'="blank""https://freecatphotoapp.com">cat photos</a>.</p

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

<p>Click here to view more <a href="https://freecatphotoapp.com">cat photos</a>.</p>
I believe this is the original line of code give to you.
All they want is for you to go to the left of the href (not the right, the left) and add the word target then = then "_blank"

target=“_blank”

Just put this new attribute into the anchor tag to the left of the href (do not put in between the href and its equal sign).

Make sure you leave one space on each side of the attribute statement.

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