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

Is there anyway to see what the correct code should be?

It keeps saying that my code is incorrect but as far as I can see its correct is there anyway to see the correct code or know which bit it wrong so I can move onto the next step

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

3 Answers

Kukon Latif
Kukon Latif
1,863 Points

cut the end anchor tag /a from below the /nav tag and paste on top nav tag.

Thanks

Austin Whipple
Austin Whipple
29,725 Points

It may be throwing an error because you have an anchor tag linking to index.html that's wrapping your entire header area. Try something like:

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

I don't think there's any way to reveal the solution, but if you try rewatching the video as a first step that might help point you in the right direction. If you watch where Nick places the nav tags, his appears after his h1 and h2, whereas your nav tags and list come right after your initial href link. This would cause your list to come before your header text. I tried the challenge with that simple change and it looks like it works alright!

 <a href="index.html">
        <h1>Nick Pettit</h1>
        <h2>Designer</h2>
          <nav>
            <ul>
              <li><a href="index.html">Portfolio</a></li>
              <li><a href="about.html">About</a></li>
              <li><a href="contact.html">Contact</a></li>
          </ul>
        </nav>
      </a>

Thanks I thought I had spelt something wrong or something but it was so frustrating me. Thanks again for the help.

I just copied and paste your solution and it still gives me the same error "Bummer! The Portfolio list item should link to "index.html". "

<!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> <nav> <ul> <li><a href="index.html">Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav> </a> </header> <section></section> <footer> <p>Ā© 2013 Nick Pettit.</p> </footer> </body> </html>