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

index.html loads fine but link to index.html is broken

Workspaces loads index.html with no problems and when I click on 'About', it loads that page as well.

However, when I click back on 'Portfolio' to take me back to index.html, I get a 404 error.

My html docs are in the correct location.

Any idea why this is occurring?

Thank you!

6 Answers

I finally figured it out - my "index.html" file was "Index.html" with a capital "I". Thanks for the help!

Can you post your code from your About page? Did you make sure "Portfolio" is linked to index.html?

It should look like the following:

<a href="index.html">Portfolio</a>
Isaac Asante
Isaac Asante
4,752 Points

Your code must be:

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

This is my code. It should contain a selected class as well.

<li><a href="index.html" class="selected">Portfolio</a></li>

My 'About' and 'Contact' code works fine and it is identical in terms of layout.

Your issue occurred when you were on your About page, correct? Can you post your code for your About page?

Isaac Asante
Isaac Asante
4,752 Points

That's right... I removed the "selected" class because I thought you hadn't reached that part yet. But this is the full code. Just double-check it's exactly the same on your index.html, about.html and contact.html page, but of course, the "selected" class should only be placed on the relevant page. Not all 3 links...

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

The issue was occurring on the About page only because I hadn't proceeded past that point in the lesson.

The issue is occurring when I try to click on the Portfolio link from any page.

This is the code for the respective pages.

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

Hi, Isaac:

My code is identical to yours and yes, of course, I have the 'selected" class placed on the relevant page.
I just put them together on the same page to show that they were identical respectively and working fine on the other pages.

I'll do some more investigating to try and figure it out.

Thanks for your help!