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

The portfolio list item should link to index.html. It's not working for me , and I'm not sure what the problem is.

<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>

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>
Stephen Little
Stephen Little
8,312 Points

Not sure what is wrong but I notice that in your index.html file you have a link right under the header tag. The closing tag for it looks to be under your h2 tag. Again not sure if that is suppose to be there, try removing it and see what that does?

Under your header tag you have a link

<header> 
<a href="index.html"> and the close for it is under your <h2>Designer</h2>

Hope this helps is some way.. cheers!

Stephen

Stephen is correct. You nested the following HTML in an anchor tag <a>

<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>

So the individual list items won't be clickable, instead, the entire code block becomes the hyperlink. Simply remove the surrounding anchor tag and this will fix your problem. There is no other issues with your syntax.

1 Answer

Thank you guys , removed the surrounding anchor tag and it worked!