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

Marc Bernardino
Marc Bernardino
810 Points

How to link index.html to portfolio

I'm not sure how to do this. I've watched the video but I just seem to not get it. Can someone tell me what im doing wrong and walk me through it? Thanks!

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>
        <h1>Nick Pettit</h1>
        <h2>Designer</h2>
      </a>
        </ul>
      </nav> 
    </header>
    <section></section>
    <footer>
      <p>&copy; 2013 Nick Pettit.</p>
    </footer>
  </body>
</html>

3 Answers

anil rahman
anil rahman
7,786 Points

This is what it should look like:

<header>
      <a href="index.html">--beginning of the link
        <h1>Nick Pettit</h1>
        <h2>Designer</h2>
      </a>--end of link
      <nav>--nav starts below that link above
        <ul>
          <a href="index.html"><li>Portfolio</li></a>--the a tag wraps around the li
          <a href="about.html"><li>About</li></a>
          <a href="contact.html"><li>Contact</li></a>
        </ul>
      </nav>
    </header>

Your nav is placed in the wrong area. It's still within the top a tag because you have not spotted the closing a tag.

Steven Parker
Steven Parker
231,210 Points

:x: The a tag should NOT wrap around the li, Marc had that part right.

:point_right: There should be nothing directly inside a ul other than li's.

Steven Parker
Steven Parker
231,210 Points

:point_right: Your nav element needs to go after the link. At the moment it overlaps the link.

Move everything you added so that it goes between the line with the </a> and the one with </header>.

Other than placement, everything looks good. :+1:

anil rahman
anil rahman
7,786 Points

Oops that's my bad copying and pasting skills lol i didn't notice that. It would still pass the challenge though but yes you are right it should be the other way round so li has a parent of ul.