Learn HTML by Building a Cat Photo App - Step 17

Tell us what’s happening:
what’s wrong with this/???
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/108.0.0.0 Safari/537.36 Edg/108.0.1462.54

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

Link to the challenge:

This is the instruction
Add a second section element below the existing section element.

What you are doing is you nest a section element instead of adding it below your existing section element

1 Like

what no im not nestingf it

1 Like

Look at your section opening tag and closing tag. That is called nesting

1 Like

i dont understand

still

1 Like

What part of the instruction that you don’t understand?

1 Like

doesn't it have to be indented to be nested

Indentation is a method for making code readable when it is nested. It is not a method to make code nested.

Here is some nested code that is not indented and is harder to read:

<main>
<p>I am nested in main</p>
<h2>so am I </h2>
</main>

Here is code that has no nesting.

<p>this is the first sibling</p>
<p>this is the second </p>
<h3>this is the third</h3>

Notice how in the nested example, the opening tag for main was before the other lines of code while it’s closing tag was included after the enclosed lines were completed? This is nesting.

Contrast that with the second example.

1 Like

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