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

Shumayel Khan
Shumayel Khan
2,369 Points

My Nav Element is Directly after the Link in the Header?

It keeps telling me to add the nav element after the link in the header, I believe that is exactly what i'm doing?

index.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Nick Pettit</title>
  </head>
  <body>
    <header>
      <a href="index.html">
        <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>

The nav and ul tag need to be placed after the closing tag of the anchor. After </a>

1 Answer

huckleberry
huckleberry
14,636 Points

Hey bro,

Simple nesting error here. Re-read that instructions and you'll notice that they want you to put it AFTER the link element. Where'd you put it? ;)

Remember that an element that is not a self-closing element, consists of 2 tags. An opening tag and a closing tag. What you did was put it after the opening anchor/link tag. But not after the actual anchor/link element.

<a href="http://google.com">
    <!-- This is inside the element but after the opening tag-->
</a>


<a href="http://google.com">

</a>

<!-- This is after the element -->

See the difference now?

So, where does it need to go?