Step 6: Need help please

Hi,
Very new to coding here and have been stuck on this step for about 1 hour. Anyway, here is the challenge

  • To make HTML easier to read, indent the ‘h2’ element, the comment, and ‘p’ element exactly two spaces to indicate they are the children of the ‘main’ parent.
    -Here is the code before I make any adjustments
  <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>

I use the the TAB button to push the ‘h2’ element over 2 spaces, then I do the exact same for the comment and p element. Like this:

<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>

It tells me that I’m doing this incorrectly and gives me the following hint: “Your h2 element should be below the main element’s opening tag and its opening tag should start 6 spaces over from the start of the line.”

Honestly, this confuses me even more. I was wondering if anyone would be willing to help walk me through this. I have read other solutions regarding this and they didn’t make sense.

Any help would be greatly appreciated!

2 Likes

When you paste code make sure you use three backticks before and after the code block. It would be good if you post the challenge link too.


If this is the correct lesson I have in my mind then yes, pressing the tab button once on the code will indent the code(will give two extra spaces)

So, you can select the h2, comment and the p and then push the tab key.
OR, individually add two spaces before the h2, comment and the p.

1 Like

Okay, thank you. I’m working on that now.

1 Like

Okay, I fixed it. Let me know if it makes sense.

Your h2, comment and the p elements are now 8 spaces away from the line instead of six.

You have to remove two spaces from them or just reset the lesson and select the h2, comment and the p and then push the tab key.
OR, individually add two spaces before the h2, comment and the p.

That was so simple and I was interpreting the information incorrectly haha. Thank you so much.

got it! pheww, we just need to select the following code using control and press tab key once!, i kept on pressing tab twice, just once guys!

Cat Photos

Click here to view more cat photos.

1 Like

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