Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Adding Pages to a Website Build the Contact Page

Denis Iucleaevschii
Denis Iucleaevschii
929 Points

Can't see the contact page.

I've tried to make a new page and after i've pasted from the about page all the contents, refreshed, but it says page not found. I tried to redo the page from new and copy again, nothing... I've also added the class="selected" to the contact page.

it looks like that:

<ul> <li><a href="index.html">Portfolio</a></li> <li><a href="About.html">About</a></li> <li><a href="contact.html" class="selected">Contact</a></li> </ul>

Can't understand why it is not showing me the contact page?

Thanks for your help.

6 Answers

A few things to check.

Make sure contact.html is in the same directory (aka folder) as index.html and about.html.

Make sure you have added or updated the anchor elements, which need link to file contact.html on both index.html and contact.html.

            <a href="contact.html"> Contact </a>

That should be inside your <nav> </nav> tags.

Also it's possible you might have a typo.

Let me know if that works for you.

Denis Iucleaevschii
Denis Iucleaevschii
929 Points

Hi Phillip, Thanks for your reply. The contact.html is in the same folder as index.html and about.html. I've updated the anchor elements in the contact.html but how do you do it in the index.html?


Hi Denis,

In order to link to contact.html from index.html, you should have the same code for your anchor elements in the index.html file.

All three files: index.html, contact.html, and about.html should have the same code inside the nav tags, except for the "selected" class attribute.

This is what the code inside my nav looks like in my index.html file:

        <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>

Let me know if that works for you.

Denis Iucleaevschii
Denis Iucleaevschii
929 Points

This is how my index.html looks like`: <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>

and the contact.html

<nav> <ul> <li><a href="index.html">Portfolio</a></li> <li><a href="About.html">About</a></li> <li><a href="contact.html" class= "selected">Contact </a></li>
</ul> </nav>

Still no chance, it says error 404, and can't see the page.

Denis Iucleaevschii
Denis Iucleaevschii
929 Points

Just tried changing browser and solved it. Safari was the problem. Don't know why. With chrome it works... So the code was ok, just the browser stopped working. Thank you for your help!! Much appreciated!


Whew! Glad you figured it out!