I keep getting the same error message: 10. Additionally, the navbar should contain link () elements with the class of “nav-link”. There should be one for every element with the class “main-section”. I don’t know what I’m getting wrong. What am I missing?
Hello there,
You have a few mis-matching HTML tags. I suggest you use the built-in HTML Analyser tool CodePen has. It will help you find most of them.
For example, these tags are out of order:
<section>
<article>
<p>Some random text</p>
</section>
</article>
Section was opened as the parent element. So, article
cannot be closed after it.
Hope this helps
@ka-kev, the complete message says;
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".
There should be one .nav-link for every element with the class of "main-section", and every .nav-link should be within #navbar : expected 8 to equal 7
AssertionError: There should be one .nav-link for every element with the class of "main-section", and every .nav-link should be within #navbar : expected 8 to equal 7
“Expected 8 to equal 7” is the clue as to where the error is.
You have a quite a few typo’s / syntax errors in your code. And one of the main-sections isn’t formatted correctly which is why the test fails.
It may help to run your HTML code through the W3C validator.
- There are HTML coding errors you should be aware of and address.
Can you elaborate what exactly “Expected 8 to equal 7” means?
In your nav
you have eight (8) .nav-link
classes that point to a main-section
Your document only contains seven (7) .main-section
s
As mentioned, you have a quite a few typo’s / syntax errors in your code. And one of the main-sections isn’t formatted correctly which is why the test fails.
You were totally right. I found the culprit using the validator. Incorrect syntax. Thank you.