skip to Main Content

I got an error while trying to go back to a root folder (folder A) from child folder (folder B "inside folder A)..
Am just confused, because am trying every way to solve the problem but am still got an error, "File not found…"

This is my code:
<a href="../folder B/folder A/index.html> Home

2

Answers


  1. [ Folder A ]
    ---- index.html
    ---- [ Folder B ]
    -------- page.html
    

    Assuming the above is your folder structure (as described) and you are going from page.html in Folder B to index.html in Folder A, then you don’t need to explicitly specify the folder name again. The following should be sufficient

    <!-- Link to Index File in Folder A -->
    <a href="../index.html"> Home </a>
    

    The ../index.html meant, leave current directory (Folder B) and go to the upper directory (Folder A) inside of which you would find index.html.

    Note: A piece of advice is to use lowercase one word (or with underscore or hyphens instead of space) for your folder names in order to avoid issues with deploying on windows and linux system (e.g. foldera, folder-a, folder_a)

    Login or Signup to reply.
  2. fix the "File not found" error when linking from folderB to folderA, use this relative path in your folderB/index.html.

    Go to Folder A

    This path moves up one level from folderB to folderA. Make sure the file index.html exists in folderA.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search