@hbar1st, thank you for responding!
So, I initially replaced my code with the code you suggested, thinking I was using too much code. Obviously, I’m very “green behind the ears” on all of this. Anyway, so when I did just your code, the test came back with failing User Story 4 again PLUS User Story 10.
User Story #10: Additionally, the navbar should contain link (a) elements with the class of nav-link. There should be one for every element with the class main-section.
So I went back to it, kept your header code, but added back in my “a id” and “section id and class” codes. It looks like this now:
<a id="Javascript_and_Java"></a>
<section id="Javascript_and_Java" class="main-section">
<header id="Javascript_and_Java">JavaScript & Java</header>
The result? Passed User Story 10 again. However, still failing User Story #4 but also #13 about the “Hello World” section (even though it was passing before this moment). So I updated all the header sections to that of the header code you suggested.
I’m still not passing #13 but when I click Hello World in the Nav Bar, it takes me to the proper section. I do have a main-doc element with a section element and a header but for some reason, it’ not passing the test now. Main-doc only has to be at the beginning of the main text right? Like this?
</nav>
<main id="main-doc">
<a id="Introduction">
<section id="Introduction" class="main-section">
<header id="Introduction">Introduction</header>
So, reading the User Story #13 error information (see below)
- When I click on a navbar element, the page should navigate to the corresponding section of the “main-doc” element
(e.g. If I click on a “nav-link” element that contains the text “Hello world”, the page navigates to a element that has that id and contains the corresponding < header>.
AssertionError: Every .nav-link should have an href value that links it to its corresponding .main-section (e.g. href=“#Introduction”). Check that these .main-section ids have corresponding href values : JavaScript_and_Java : expected 1 to equal 0
Since User Story 13 mentioned the Hello World section, here’s what I’ve got going for it:
Navigation Bar
<a class="nav-link" href="#Hello_World" rel="internal">
<li>Hello World</li>
</a>
Main Doc
<a id="Hello_World"></a>
<section id="Hello_World" class="main-section">
<header id="Hello_World">Hello World</header>
Then, after reading the Assertion Error mentioning Introduction, I double checked and it does have “main-section” in the Main Doc HTML codes. I also looked at my Nav Bar codes.
Nav Bar:
<a class="nav-link" href="#Introduction" rel="internal">
<li>Introduction</li>
</a>
Main Doc:
<a id="Introduction">
<section id="Introduction" class="main-section">
<header id="Introduction">Introduction</header>
Needless to say, I’m not sure why User Story #13 is failing just because I changed the header information in an attempt to pass User Story #4. Which, is still failing.
Sidenote: I used blockquotes to keep Nav Bar and Main Doc codes together but separate for ease of reading. Hope that doesn’t add any confusion to this already long post.
UPDATED: Literally copied “Javascript_and_Java” from the nav-link href=“#Javascript_and_Java” to the Main Doc section of the JS and Java code and I passed #13 again. My bad for putting everyone through all that. That was a big Derp moment.
Still taking suggestions for passing User Story 4 though.