HTML HTML Basics Images, Text and Links Understanding File Paths

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>


3 Answers

Mark Tripney
Mark Tripney
6,009 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!

Thanks Mark!

Alexandra Cianciara
Alexandra Cianciara
2,465 Points

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

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

Here is my worksheet. Can you please check

Mark Tripney
Mark Tripney
6,009 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?