Help me pass this stage Anyone

it says: Your anchor ( a ) element should be nested within the p element.

<html>
  <body>
    <h1>CatPhotoApp</h1>
    <main>
      <h2>Cat Photos</h2>
      <!-- TODO: Add link to cat photos -->
      <p>Click here to view more cat photos.</p>
         <a href="https://freecatphotoapp.com">cat photos</a>
      <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>

The lesson provides you with the following code in the editor:

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

The goal here is to replace the words “cat photos” in the p element with the words “cat photos” in the provided anchor (a) element. To do this you need to delete the first instance of the words and move your a element to the correct spot.

Notice where your <a> tag is

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

it is supposed to be inside the <p> tag

Thank you everyone…

Now I need to pass this, it says : Your anchor ( a ) element does not have a target attribute. Check that there is a space after the opening tag’s name and/or there are spaces before all attribute names.

<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>

> Blockquote

If you remember lesson 9 it tells you how to add an alt attribute with the text of A cute orange cat lying on its back. You can apply all attributes in the same manner. In lesson 9 the text would be referred to as the value.

So in this lesson when it tells you to add a target attribute with the value of _blank it wants you to apply it the same way you did with the alt text.

Hello
It didn’t work
I’m confused

So, attributes in HTML are often times assigned what is known as a value. Very few attributes exist that do not get assigned some sort of value.

In the lesson it wants you to assign the target attribute with the value of _blank to the (a) element. The (a) element, otherwise known as the anchor element in HTML looks like this:

<a></a>

It will always have an attribute of href with a value of a link of some kind. This link can be to anywhere. It can be seen below:

<a href="url">This is the (a) also known as anchor element with an attribute of (href) and a value of (url).</a>

Using this logic you should be able to apply the target attribute with the value of _blank to the appropriate element.

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