How To Link One Html Page To Another One In Another Folder
Solution 1:
To link to another file WITHIN your web site structure, you should use relative references. Relative means, relative to the currently loaded resource.
To access something in the same folder: Just use the file name:
<ahref="file.html">Click Me<a>
To access something in a child folder: Start with the child folder name, a slash, and the file name:
<ahref="childFolder/file.html">Click Me<a>
To access something starting at the root of your site, begin the path with a forward-slash:
<ahref="/pathToFile">Click Me<a>
To access something in a parent folder, start with two dots and a forward-slash:
<ahref="../file.html">Click Me<a>
To access something that is in a combination of the above, like a sibling folder, you need to go up to the parent and then down to the correct child:
<ahref="../digital-clock/index2.html">Click Me<a>
As an initial test to make sure the file exists, temporarially place it in the same folder as the current page and see if the first example I showed works. If not, you've got a different issue than you think.
Next, you mention that index2.html
is in the digital-clock
folder, but you didn't reference that folder in your link, so make sure to include that. But, depending on where that folder is will dictate which method I've shown above you need to use.
Solution 2:
This should work
<a href="../rock-paper-scissors-game2/index2.html">Game</a>
Post a Comment for "How To Link One Html Page To Another One In Another Folder"