HTML HTML Basics Images, Text and Links Understanding File Paths

Mia Casesa
Mia Casesa
2,908 Points

Can't get the link to Home tab in the articles.html to index.html

I think the file path is ok, an I don't see any syntax errors, so I'm not sure why it's not working.

<li><a href="../index.html">Home</a></li>

Thanks!

https://teamtreehouse.com/workspaces/38333302#

3 Answers

Mark Tripney
Mark Tripney
Full Stack JavaScript Techdegree Student 4,564 Points

Hey Mia. You need to tell the browser to go 'up' two levels to access index.html. So, your code should read...

<li><a href="../../index.html">Home</a></li>

This is necessary because the page you're viewing is in its own folder (2017), so you need to get out of that (up once) and then out of another folder (Articles) in order to reach the root, where index.html resides. Hope that helps!

Alexandra Cianciara
Alexandra Cianciara
2,127 Points

I have the same problem. I'm doing it exactly like you have it and it's not linking back:

<ul>
                <li> <a href="../../index.html">Home</a></li>
                <li> <a href="#">About</a></li>
                <li> <a href="#">Articles</a></li>
                <li> <a href="#">Contact</a></li> 
              </ul>

Here is my worksheet. Can you please check

https://teamtreehouse.com/workspaces/38720062#

Mark Tripney
Mark Tripney
Full Stack JavaScript Techdegree Student 4,564 Points

Hey Alexandra. What does your folder structure look like? Do you have index.html in the 'root' and articles.html in a folder within the 'Articles' folder?