HTML & CSS
My issue is how to use the same link paths for my navigation menu in my index.htm that I do for the pages that occupy subordinate directories.
As I see it, the index.htm must be in the root directory whereas I want my other htm pages in their own subdirectory.
The hangup I see in doing so is that each navigation link in my index.htm would have to use "directory/page.htm" as the href=, whereas the links from the subdirectory pages will have to be "../directory/page.htm" right?
Other than redirecting my index.htm to its own subordinate directory or creating a cute php approach, is there a way to create a single navigation excerpt?
Indeed there is, by putting a / in front of each href the link paths will remnain correct no matter what page you are on, eg
Or a better way of doing it is to use a directory path approach, if you change index.htm to index.php it will still work...
Just want to confirm that what makes the "better way" work is that all my markup files are named index.htm (or. php) within their directory.
It means that if at some point you change /directory/index.htm to /directory/index.php you won't have to update the navigation HTML...
This topic is now closed. New replies are no longer allowed.