Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Creating HTML Content Create Navigation with Lists

What is it exactly asking?

So the question is asking me to put the navigation and un ordered list elements. <nav></nav> and <ul></ul> Right after the link.

I tried a couple of different ways but it keeps saying that the <nav> needs to be right after the link. So I add to the hyper link with the nav and it keeps telling me I am wrong. I have also been stuck on this question for 2 days.

<a href="" nav>

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

Something like this?

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

It didn't work. T.T It is asking me this, "Create a navigation element with an unordered list element after the link inside the header. Don’t add any list items or links just yet."

Then when I do that it says, " Bummer! Be sure your <nav> element is directly after the link in the header."

I have no idea what is going on.

No, I am not from Narnia Alexander Davison . I wish I was, I just thought it was neat and put it their.

Um... Anna... You aren't from Narnia, are you?! It's not a real world (at least I'm pretty sure it isn't)

5 Answers

Ryan Dudley
Ryan Dudley
Treehouse Project Reviewer

Ok, so you need to create a nav element right after the anchor and include an unordered list with no list items in it just yet.

So that would look something like this:

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

Hope that solves the issue for you!

Thank you so MUCH Ryan Dudley .

Michael Lawinger
Michael Lawinger
33,581 Points

Hey I think this would work!

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

It still didn't work. Thank you both for helping me though. I don't know.

Michael Lawinger
Michael Lawinger
33,581 Points

So I noticed one thing to begin with you had a ? instead of a > closing the title. So you code in the middle is what you add. The reason is cause it comes right after the link, which the links are the <a> elements! The nav is the navigation element and the ul is inside of the nav because you will end up make a list of links!

<!DOCTYPE> 
<html> 
<head> 
<meta charset="utf-8"> 
<title>Nick Pettit</title>
</head> 
<body> 
<header> 
<a href="index.html"> 
<h1>Nick Pettit</h1> 
<h2>Designer</h2> 
</a> 
<nav>
<ul>
</ul>
</nav>
</header> 
<section></section> 
<footer> 
<p>© 2013 Nick Pettit.</p> 
</footer> 
</body> 
</html>
Michael Lawinger
Michael Lawinger
33,581 Points

Oh, but get rid of the </a> tag.

That didn't work either.

Michael Lawinger
Michael Lawinger
33,581 Points

Can you copy the question and the code that it gives you to start with, I know how it feels so I want to they and help.

Create a navigation element with an unordered list element after the link inside the header. Don’t add any list items or links just yet.

Then it has a whole bunch of code that I am about to type since my device doesn't want to cooperate.

<!DOCTYPE> <html> <head> <meta charset="utf-8"> <title>Nick Pettit</title? </head> <body> <header> <a href="index.html"> <h1>Nick Pettit</h1> <h2>Designer</h2> </a> </header> <section></section> <footer> <p>© 2013 Nick Pettit.</p> </footer> </body> </html>

I apologize if i made any mistakes.