[SOLVED] How do you reference back to a parent folder in html?

Issue

This Content is from Stack Overflow. Question asked by chester

I’m having trouble referencing back to parent folders using html. Here is a picture of my folder:

folder pic

The below code is index.html:

<html>
        <title>HTML Experiments</title>
        <h1>This is a website that I made</h1>
        <ul>
            
            <li>Here is another file: <a href="InsideTheRootFile1.html">another file</a></li>
            <li>Here is an extra file: <a href="extras 1/insideextras.html">extras</a></li>
            
        </ul>
</html>

Here is insideextras.html:

<html>
        <h1>it worked!</h1>
        <p>here you can go back to index: <a href=".../index.html">index</a></p>
</html>

Index.html works OK and I can access insideextras.html from there, but when I try to go back to index.html it doesn’t work. Any suggestions?



Solution

You got an extra dot.

Just fix

<p>here you can go back to index: <a href=".../index.html">index</a></p>

to

<p>here you can go back to index: <a href="../index.html">index</a></p>


This Question was asked in StackOverflow by chester and Answered by Kurt It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?