Help With Technical Documentation Page, Did All Of The Requirements But It's Not Recognizing It

Project Link: https://codepen.io/Potato1010/pen/eYzvpaB (ignore the wonky colors & anything random It’s a work in progress still)

So I’ve done all of the requirements, but It’s not letting me pass, I don’t know If It’s from me or probably bugged, can anyone help ?
I can’t find the error, so any help would be appreciated…

Hi there.

On line 98 …

<section class="main-section" id="JavaScript and Java">

you need to replace the spaces with underscores:

<section class="main-section" id="JavaScript_and_Java">
1 Like

Looking at the first failing test:

  1. 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”).

Some “main-section” elements are missing the following ids (don’t forget to replace spaces with underscores!) : JAVASCRIPT_AND_JAVA : expected 1 to equal 0 AssertionError: Some “main-section” elements are missing the following ids (don’t forget to replace spaces with underscores!) : JAVASCRIPT_AND_JAVA : expected 1 to equal 0

This is in reference to the user story:

User Story #4: Each section element with the class of main-section should also have an id that corresponds with the text of each header contained within it. Any spaces should be replaced with underscores (e.g. The section that contains the header “JavaScript and Java” should have a corresponding id="JavaScript_and_Java" ).

When I look in your code, for that section “JavaScript and Java”, I see that the nav is:

<a href="#JavaScript_and_Java" class="nav-link">JavaScript and Java</a>

and the element has:

    <section class="main-section" id="JavaScript and Java">
      <header>JavaScript and Java</header>

Do you see the issue?

Hint 1:

The nav is correct, but the id on the element is wrong.

Hint 2:

HTML ids can’t have spaces.

When I fix that, the page passes.

1 Like

Thanks Alot !!, Didn’t know Id’s couldn’t handle spaces, does that mean that rule applies to classes aswell

I Thought Spaces Would Be Fine Or Recognizable Because When I Clicked On It , It redirected me to It, thanks alot !!

1 Like

Well yeah, there is a rule for ids. For classes it gets a little more complicated because you can apply multiple classes, separated by a space. For example:

<div class="red headline">

That is applying two classes, “red” and “headline”. So classes should follow a similar rule.

1 Like