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 Use the Navigation Element

Divya Vyas
Divya Vyas
205 Points

Why I am not getting hyper links and list items after clicking the Preview button ?

<!DOCTYPE html> <html> <head> <meta charset="utf-8">

<title>
     Ayushi Vyas | Traveller
</title>
</head> 
<body>

  <header>
    <a href="index.html">
    <h1>Ayushi Vyas</h1>
    <h2>Traveller</h2>
    </a>

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


      </ul>
    </nav>

    </header>


  <section>
    <p>Gallery will go here</p>

  </section>
  <footer>
  <p>&copy;2014 Ayushi Vyas</p></footer>


</body>

</html>

Kailash Seshadri
Kailash Seshadri
3,087 Points

Hello Ayushi!

Try remove all the unnecessary spaces from the html eg. between the last <li> and the closing </ul> tag and also check if the indentation is correct in all lines.... If you can can you please share a snapshot of your workspaces: If you dont know how to please check here

Thanks and Happy Coding!!

Nishant Kumar
Nishant Kumar
1,179 Points

Hi Divya

It's working very well. For instance, add url "www.google.com" instead of your "index.html" and it will work. i.e. replace <a href="index.html"> with <a href="http://www.google.com">. Let me know if it works.

Thanks

1 Answer

Marie Loson
Marie Loson
795 Points

Hi Divya,

I think your question has to do with the nav menu that you created. If so, you don't have hyperlinks for your list items because you did not include an anchor element within them.

Using your code above, it would need to look something like this:

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

Hope this helps!

Hey Divya, I was inserting the Portfolio after the </a>, I referenced your question and was able to find out my problem. (Thanks to Marie!)