Learn HTML by Building a Cat Photo App - Step 17

Tell us what’s happening:

Sorry, you code doest not pass.
Instruction add a second section below the first section

Your code so far

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>

<!-- User Editable Region -->

      <section>
        <section>
        <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
        </section>
      </section>
      

<!-- User Editable Region -->

    </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/126.0.0.0 Safari/537.36

Challenge Information:

Learn HTML by Building a Cat Photo App - Step 17
https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-html-by-building-a-cat-photo-app/step-17`

CatPhotoApp

Cat Photos

See more cat photos in our gallery.

A cute orange cat lying on its back.
</main>
`

i think its

<section>
</section>
<section>
</section>

i think i had the same issue

1 Like

Hi there!
You need to add a second section element below the first one.
Currently you have nested the previous section element within the new section element. You need to add both new opening and closing section tags after your first closing section tag.

1 Like

I did but I cannot pass the step 17.

<section>
        <section>
        <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
        </section>
      </section>

I doesn’t seen any changes in your code. It is same as the previous.

Example

<div>
<h1></h1>
<p></p>
</div>
<div></div>

Above I added a div element after the div element. Now add your section element after the existing section element.

<section>
        <section>
       <div> <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
        </div>
        <div><a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
        </section>
      </section>
      </div>

Still error cannot pass

You didn’t need to add div element in your code. The instructions is asking you to add section opening and closing tags after the existing section element.
Reset your code and read the instructions carefully, then try again.

1 Like
<section>
       <section> 
       <h2>Cat Photos</h2>
       
        <!-- TODO: Add link to cat photos -->
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p></section>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
        
      </section>

Sorry, your code does not pass. Hang in there.

The second section element should not be nested in the first section element.

<section>
       <section> 
       <h2>Cat Photos</h2>
       
        <!-- TODO: Add link to cat photos -->
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p></section>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
        
      </section>

You have add a section opening tag above your existing section tag. Move it below the existing section closing tag. Then add another closing section tag.

2 Likes

it doesn’t work. Can you help me please?

Hello @eito2307 !

It would be good to reset Step 17
(no other code will be affected with the reset)

to remove any failed code, and to begin with the original provided code for the step.

Then, before entering any code, find the closing </section> tag.

Then, below that enter the new section element.

Place both the opening and closing tags on the same line, together.

<opening tag></closing tag>

Then, submit the code and it should pass for you.

Wishing more good progress and happy coding!

2 Likes

Hi there,

A section element consists of an opening tag <section> and a closing tag </section>.

The provided code looks like this:

     <section>  <== first section opening tag
          <h2>Cat Photos</h2>
          ....
     </section> <== first section closing tag

Your code look like this:

<section>   <== second section opening tag
     <section>  <== first section opening tag
          <h2>Cat Photos</h2>
          ....
     </section> <== first section closing tag
</section>  <=== second section closing tag

What you did was:
nest the fisrt section element inside the second section element.

What we need to do is:
add second section element below the first section element.

Like this:

     <section>  <== first section opening tag
          <h2>Cat Photos</h2>
          ....
     </section> <== first section closing tag
     <=== ADD THE SECOND SECTION HERE (both opening and closing tags)

You should reset the step and try it again. Happy coding!

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

I cannot pass it.

I reset it but It doesn’t work

Hi @eito2307 ,

You should reset the code and try again.
This time, you replace the text [NEW SECTION HERE] below with a new section element:

      <section>
        <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
      </section>
      [NEW SECTION HERE] 

Remember, a section element is consists of opening tag and closing tag:

<section></section>
1 Like