Step 6 problem solving

Step 6

HTML elements are often nested within other HTML elements. In the previous step you nested the h2 element, comment and p element within the main element. A nested element is a child of its parent element.

I don’t know how to solve the step 6 problem.

To make HTML easier to read, indent the h2 element, the comment, and p element exactly two spaces to indicate they are children of the main element.

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

<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>
  </main>
</body>
</html>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36

Challenge: Step 6

Link to the challenge:

Hey there! Welcome to the forums :wave: :slightly_smiling_face:

Indentation and whitespace in HTML is mostly for readability (the only exception that comes to mind right now are attributes but that’s besides the point).

Currently they just want you to indent lines 5, 6 and 7, two spaces in. That way you can visually see that they are children of <main>.

It might help to reset the lesson if you’ve already got an odd mix of indentations.

Thank you very much. Thank you again

1 Like

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