When I click a .nav-link button in the nav element, I am taken to the corresponding section of the landing page.Product Landing page

I’ve been trying to fix errror number 5 in the Product Landing page. I have all the sections with their respective ids in the href attribute. Please, check my code and help me find my mistake.

Build a Product Landing Page

Link to the challenge:

Welcome to the forums @ulugbekobilov.
Keep the test script when forking the pen (<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>)
The test script, with all tests passing, should be included when you submit your projects.

When a test fails click the red button to see which test(s) are failing and text to help you correct the issue.
Be sure and read more than just the first line of the failing message. The ability to read and comprehend error messages is a skill you’ll need to acquire as a developer. Ask questions on what you don’t understand.

The failing message says

When I click a .nav-link button in the nav element, I am taken to the corresponding section of the landing page.'
Each .nav-link element should have an href attribute : expected false to equal true
AssertionError: Each .nav-link element should have an href attribute : expected false to equal true

Do you understand what the test is looking for?
HINT: It says .nav-link element should have an href attribute. Which of your elements has the .nav-link class?

EDIT: On a side note…

  • Run your HTML code through the W3C validator.
    • There are HTML syntax/coding errors you should be aware of and address.
  • Do not use the <br> element to force line breaks or spacing. That’s what CSS is for.

Thank you very much, you’ve opened my eyes. I thought that if I include the class in a parent element, that would be enough.

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