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

Jasmine De La Cruz
PLUS
Jasmine De La Cruz
Courses Plus Student 152 Points

creating navigation with lists. getting error: "Bummer!"

What am I doing wrong?! I have tried over and over. I've tried <li>, <ul>, <ol>, and all in different orders. I'm lost.

index.html
<!DOCTYPE html>
<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> Portfolio</ul>
        <ul> About </ul>
        <ul> Contact </ul>
      </nav>
    </header>
    <section></section>
    <footer>
      <p>&copy; 2013 Nick Pettit.</p>
    </footer>
  </body>
</html>
Anthony Domina
Anthony Domina
Courses Plus Student 19,571 Points

use ul or ol only once. li is a list item and these are what need to go in between your ul or ol:

<ul>
  <li></li>
  <li></li>
  <li></li>
</ul>

4 Answers

<nav> <ul> Portfolio</ul> <ul> About </ul> <ul> Contact </ul> </nav>

here is the mistake you made.

Peter Lee
Peter Lee
11,589 Points

you shouldnt put h1/h2 tag inside a an href. you should have the href inside the h1 tag.

you can try something like this

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Nick Pettit</title>
  </head>
  <body>
    <header>
      <h1>
        <a href="index.html">
          Nick Pettit <small>Designer</small>
        </a>
      </h1>
      <nav>
        <ul>
          <li>Portfolio</li>
          <li>About</li>
          <li>Contact</li>
        </ul>
      </nav>
    </header>
    <section></section>
    <footer>
      <p>&copy; 2013 Nick Pettit.</p>
    </footer>
  </body>
</html>
Michael Lambert
Michael Lambert
6,286 Points

Peter Lee There is nothing wrong with putting h1, h2 elements inside an anchor element and seeing the 'a' element to display: block

Natalya Nikolaeva
Natalya Nikolaeva
2,026 Points
<header>
      <a href="index.html" id="logo">
        <h1>Nick Pettit</h1>
        <h2>Designer</h2>
      </a>
      <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>
    </header>
mahmoud gamie
mahmoud gamie
8,054 Points

Hello, inside your <nav> you should first open a <ul>, then put the <li> items inside your <ul> like this :

<nav>
    <ul>
          <li>Portfolio</li>
          <li>About</li>
          <li>Contact</li>
    </ul>
</nav>