Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Creating HTML Content Create Navigation with Lists

How do I find the answer to one of the challenge questions to pass the task?

I am not changing any code except adding the list items, however I can't move past the task because it says that once I add the list items then the first task is wrong. How can I move past this challenge and keep going?

index.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Nick Pettit</title>
  </head>
  <body>
    <header>
      <a href="index.html"> 
        <nav>
          <ul>
            <li>Portfolio</li>
            <li>About</li>
            <li>Contact</li>
          </ul>
        <h1>Nick Pettit</h1>
        <h2>Designer</h2>
          </a>
        </nav>  
    </header>
    <section></section>
    <footer>
      <p>&copy; 2013 Nick Pettit.</p>
    </footer>
  </body>
</html>

2 Answers

andren
andren
28,558 Points

Sadly you can't really see the official solution without either asking for help here in the forum, or by googling the question and finding some older post where somebody else asked for help with the challenge.

Anyway as for your actual problem, there are two issues with your code:

  1. You place the starting tag of the "nav" element inside the "a" element, but the ending tag of the "nav" element outside the "a" element, this is invalid. The start tag and end tag have to be within the same element.

  2. The "nav" element is not supposed to be within the "a" element to begin with, the challenge ask for the "nav" element to be added after the "a" element, not within it.

Fixing those two issues leads to this code:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Nick Pettit</title>
  </head>
  <body>
    <header>
      <a href="index.html"> 
        <h1>Nick Pettit</h1>
        <h2>Designer</h2>
      </a>
      <nav>
        <ul>
          <li>Portfolio</li>
          <li>About</li>
          <li>Contact</li>
        </ul>
      </nav>  
    </header>
    <section></section>
    <footer>
      <p>&copy; 2013 Nick Pettit.</p>
    </footer>
  </body>
</html>

Which will pass the second task.

Dang it, looked at it again and I see what you're saying! Thanks so much for bearing with me!

That's what I had originally put in the first question but when I did that it told me my code was wrong and my <nav> had to be directly behind the link, so I had to switch the closing tags and passed the first question. When I go to the second question and add the list items and leave the tags as is or if I change them and put them in the correct order, I get an error that I've changed some part of the code from the first challenge.

I'm too much of a novice to believe this is an actual bug LOL