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

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!