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

Kate Williamson
Kate Williamson
548 Points

I am getting an error that Portfolio should be linked to Index.html. I have:<li><a href="index.html">Portfolio</a></li>

I am working on How to Make a Website challenge task 3 of 3 and getting an error message that Portfolio should be linked to Index.html. I thought that's what I was doing with my code- which is attached. I would appreciate any guidance. 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>
    </header>
    <section></section>
    <footer>
      <p>&copy; 2013 Nick Pettit.</p>
    </footer>
  </body>
</html>

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,857 Points

Hi Kate,

The key phrase in the challenge is "after the link inside the header."

So your code is correct... just not in the right place. What you added needs to be put after the closing 'a' tag after the "index.html" not before.

<header>
      <a href="index.html">
        <h1>Nick Pettit</h1>
        <h2>Designer</h2>
      </a>
     <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>
  </header>

Hope that helps! :) Jason

kimberly Liu
kimberly Liu
5,316 Points

Remember to set the selected page with the selected class...

/** for this page, the portfolio page is selected in index.html-->**/ <li><a href="index.html" class="selected">Portfolio</a></li> <li><a href="index.html">About</a></li> <li><a href="index.html">Contact</a></li>

...maybe that's not the answer to your question, but it's something I noticed in your code which might cause trouble when working with multiple pages...if you're working with the contact page...then that should be the class selected...and so on with the about page...

Kate Williamson
Kate Williamson
548 Points

That's good advice, Kimberly. Thank you!