Search code examples
htmlhyperlinkanchorhref

Is there an easier way to link back to the index.html file?


I am trying to link back to my index.html from a sub folder inside my portfolio, right now I have a method that "works", but it feels like the long route. Here is what the "link" looks like in Notepad++ <a class="navlist" href="/College/Tech%20Classes/HTML%20and%20JavaScript/Midterm%20Project/index.html">Home</a>.

I was curious if there is a different/easier way to link back to my index.html?

Edit: I guess I should mention that I am doing this within this said folder/html file L:\College\Tech Classes\HTML and JavaScript\Midterm Project\HTMLJava\htmljava.html.


Solution

  • You can use a relative link where .. means going up one folder. E.g.:

    <a class="navlist" href="../index.html">Home</a>