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

The code challenge asked for <nav> & <ul> tags to be under the link within the header. I've done this, but get an error.

The code challenge asked for the <nav> & <ul> to be directly under the link in the header. I've done this, yet it returns an error when I submit saying "Be sure your <nav> element is directly after the link in the header." <header> <a href="index.html"> <nav> <ul> </ul> </nav> <h1> Nick Pettit</h1> <h2>Designer</h2> </a> </header>

That is currently what is in the Code Challenge. Thank you for your time.

5 Answers

Mark Josephsen
Mark Josephsen
8,803 Points

Ah, this is the error. Your link ends after the closing tag. So, your nav and ul elements should be after that closing tag. Not before.

Oh okay!! That makes sense. Thank you for your help. I just now saw your comment, and that fixed my problem. Thanks once again.

Mark Josephsen
Mark Josephsen
8,803 Points

It's after the closing link tag? < /a>

The closing </a> is already in place after the <h1> & <h2> tags. Yes the code challenge asks for there to be a nav & ul element after the link in the header.

Sean, here's how to post code on the forums. Start with 3 backticks (near your Esc key probably) and the language right after. Hit enter to start a new line, then paste your code. Once you've finished your code block, hit enter at the bottom and put another 3 backticks to close it.

```html
<header>
  <h1>Paste your HTML code inside the triple backticks</h1>
</header>
```backticks here to end the code block

@Bryan H

Yes my code looks exactly like that. How do I go about posting my code? I initially typed it all out on my first post but I guess that's not displaying?

Like Mark said, you need to place the nav element after the </a>, otherwise it's inside, not below.

I'll edit my previous comment to show you how to post code in the forum.

Mark Josephsen
Mark Josephsen
8,803 Points

You'll want your nav and ul elements after the closing < /a> tag. Otherwise, it's inside the link instead of after it.

Thanks for the helps guys! it worked. @Bryan H, yes please update your post or send me a link on how to post my code in the forum for future projects. Thanks once again guys.