Hello, I need some help!

I’ve got this test that I can’t pass!

4. Each element with the class of “main-section” should also have an id comprised of the innerText contained within it, with underscores in place of spaces. The id may include special characters if there are special characters in the respective innerText. (e.g. The that contains the header, “JavaScript & Java”, should have a corresponding id=“JavaScript_&_Java”).

What I don’t underestand is if I have to use a ‘header’ element or headings

?

I don’t underestand because the layout makes no sense.
or It makes sense because it is within a section?

You can check my project here - https://codepen.io/Mikeavocado01/pen/rNYXJYo

Why are you making the ids all uppercase? I don’t think that is part of the requirement. I’m thinking that is causing you to fail this test.

I gotta fix that and I’ll come back if I’m still not passing it! Thanks!

Hello mike try this

<section class = "main-section"   id = "header_text">
      <header>
          <h1>
          header text
          </h1>
      </header>
 </section>

Hi @Mike01,
You have actually done it correctly for quite a few of your “main-sections”. For example, you did it right for the “Introduction to recursion”, “recursive function call” and “stack limitation”. BUT after that there is a mismatch between what you have in the header compared to the id you have used for the section. Just as an example, this code would be incorrect:

<section class="main-section" id="SINGLE_AND_MULTIPLE_RECURSION">
            <header class="subt title" >Single recursion and multiple recursion</header>

Because there is not a match between the id and the header (both would need to be either “SINGLE_AND_MULTIPLE_RECURSION” or “Single recursion and multiple recursion” (the fact that you are using lowercase in the header text and uppercase in the id, seems to be ok for the system, in this particular case). So for that particular section of the code it could be:

<section class="main-section" id="SINGLE_AND_MULTIPLE_RECURSION">
            <header class="subt title" >Single and multiple recursion</header>

A good extra tip: For each of the user stories, when you test them you can see on the first line some extra information that can help you understand more what went wrong/was expected (for example “expected X to be equal to 5 but is only equal to 2”). In your case you can see what heading text that are not matching the corresponding id:

Hope it helps.

2 Likes

“header-text” or “header_text”? check spelling and grammer issues.

1 Like

Hello deerose818
For the the same challenge above the ID for the section tag will be “header_text”

<section class = "main-section"  id = "header_text">
    <header>
        <h1>
          Header text
        </h1>
    </header>
</section>
1 Like

Thanks for your answer! You’re great!

Thanks a lot this helped me fix the error! Now I have others hahahaha I’ll be solving them! Thanks again!

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