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

True Bey
True Bey
166 Points

Why when working on list items does contact differ in that it's contact.html whereas the others start with index.html?

Thanks

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>
          <li><a href="index.html"</a>Portfolio</li>
          <li><a href="index.html"</a>About</li>
          <li><a href="contact.html"</a>Contact</li>
        </ul>
      </nav>
    </header>
    <section></section>
    <footer>
      <p>&copy; 2013 Nick Pettit.</p>
    </footer>
  </body>
</html>

2 Answers

The exercise asks you to link Portfolio to index.html, About to about.html (not index.html), and Contact to contact.html. As to why, it's because the designer simply designed his example pages to link to each other that way. Also, you closed your links before enclosing the text indicating what they are to link to.

Gunhoo Yoon
Gunhoo Yoon
5,027 Points

So are you curious why they are named like that?

First of all file names are just there to help you organize content. There's nothing special to them except for one thing.

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

index.html is little special because of how the web server traditionally have treated them. They work as your default page when user try to visit your site.

This achieves two things.

  1. When your user visit your site, your user will be directed to index.html.
  2. If you don't have index.html your user will see your file system instead of web page. Then they need to click each files to see the content of page.

Hope it helps.