Learn HTML by Building a Cat Photo App - Step 16

The lesson tells me to add a second section element under the first one, when I do so it says not to nest the second the element. When I back space and move the second one all the way to the margin on the left it still does not count for some reason.

  **Your code so far**
<html>
<body>
  <h1>CatPhotoApp</h1>
  <main>
    <section>
    <section>
      <h2>Cat Photos</h2>
      <!-- TODO: Add link to cat photos -->
      <p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</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>
  **Your browser information:**

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14909.100.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

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

Link to the challenge:

When you nest an element inside of another element, the order in which you close the elements matters a lot. The nested element needs to be exactly inside of the parent element or it won’t be considered as correct syntax. for example:

This is not correct.

// h1 is the parent
<p>
    //span is the child
    <span> 
    </p>
</span>

This would be considered correct syntax.

// h1 is the parent
<p>
    //span is the child
    <span> </span>
</p>

Hope this helps! :smile:

Yes thanks, I figured it out.
I had the code:

<html>
 <body>
  <section>
  <section>

  </section>
  </section>
 </body>
</html>

It should have been:

<html>
 <body>
  <section>
  </section>
  <section>
  </section>
 </body>
</html>
1 Like

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