Learn HTML by Building a Cat Photo App - Step 12

Tell us what’s happening:

How do i nest a new anchor (a) element in this code

See more cat photos in our gallery

cat photos

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 cat photos in our gallery</P>
      <a href="https://freecatphotoapp.com">cat photos</a>

<!-- User Editable Region -->

<a  href="https://freecatphotoapp.com">cat photos</a>



      <a href="https://freecatphotoapp.com">link to cat pictures</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>

Your browser information:

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

Challenge Information:

Learn HTML by Building a Cat Photo App - Step 12

1 Like

Welcome to the forum @cordis

Place the opening anchor tag before the word cat in the paragraph element.

Then close the new element by placing the closing anchor tag after the word photos.

Here is an article explaining how to link text and images inside nested elements you may find helpful.

Make sure to remove the second anchor element.

Happy coding

4 Likes

To make something into a link/anchor, surround it with the opening and closing anchor tags.

Example:
(This is an example not the answer)
This code has no links

<h1>Welcome to the page</h1>
<p>An example of creating links within an existing page</p>

This code creates links from existing content

<h1>Welcome to the <a href="someWebsite1.com">page</a></h1>
<p>An <a href="someWebsite2.com">example of creating</a> links within an existing page</p>

The word ‘page’ in the header is a link
The words ‘example of creating’ is another link

2 Likes

LOOK AT MY CODE, TRY TO UNDERSTAND THE DIFFERENCE AND REDO ON YOUR PAGE.

A cute orange cat lying on its back.

:smiley:

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

1 Like

ah okay, I did not know so.
my apologies

2 Likes