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

Richard Mullins
Richard Mullins
1,285 Points

List items typed correctly but not working as the answer

<li><a href="index.html">Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li>

Its saying the Portfolio list item is not linked to the index.html page

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; 2015 Richard Mullins.</p>
    </footer>
  </body>
</html>

6 Answers

Kristopher Van Sant
PLUS
Kristopher Van Sant
Courses Plus Student 18,830 Points

Welcome to Treehouse Richard! I wanted to break down each challenge task for you so you can understand better what is going on and what is wrong with code you currently have.

Challenge Task 1 - Asks you to create a nav element with an ul element AFTER the link inside the header. You've placed your nav within the opening and closing link tags. It should come after the closing link tag.

  <header>
      <a href="index.html">
        <h1>Nick Pettit</h1>
        <h2>Designer</h2>
      </a>
      <nav>
        <ul></ul>
      </nav>
   </header>

Challenge Task 2 -Inside the nav element create 3 list items with the words Portfolio, About, and Contact. You did this portion successfully, although you have the h1 and h2 and an link tag in the way.

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

Challenge Task 3 - Asks you to "Link each of the three list items. Portfolio should go to “index.html”, About should go to “about.html”, and Contact should go to “contact.html”." You did this part successfully as well.

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

However, since you originally placed the nav within the link tags that surround the h1 and h2 the challenge won't pass. Because what you have is not correct. (Yes even though it passed the first two challenges) The first error message you get talks about not having "portfolio" attached to index.html, this is probably saying this because it's seeing the first link with the href "index.html" and thinking that THAT is the one that should have the Portfolio list item. Hope this helps!

Emil Rais
Emil Rais
26,873 Points

Be mindful of your indentation, it will sometimes mess with Treehouse's parser. It's the job of that parser to be able to read and recognize your code as correct.

Make it so that the ul element is indented 2 spaces relative to nav. Make it so that the li elements are indented equally and 2 spaces relative to ul. Then check to see if the parser will recognize the code.

Richard Mullins
Richard Mullins
1,285 Points

Thanks! I'm new to Treehouse and sort of sloppy about indents it seems.

Did that adjustment work?

Richard Mullins
Richard Mullins
1,285 Points

Thanks for all the help! I misunderstood the instructions somehow. It's fine now.

Alen Subasic
Alen Subasic
12,279 Points

Take a look at this code below

<!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> <!-- I think this should be outside your <ul>  -->
      <h2>Designer</h2> <!-- I think this should be outside your <ul>  -->
      </a> <!-- Is this <a> closed in the correct spot? -->
      </ul> 
      </nav>
    </header>
    <section></section>
    <footer>
      <p>&copy; 2015 Richard Mullins.</p>
    </footer>
  </body>
</html>