activity 9.2 Link


Downward Linking

Open your "main" folder and make a new subfolder called "folder1". Move "page2.html" and "page3.html" into this new "folder1" directory. Open your "main" folder and you should see "page1.html" and "folder1". The directory "folder1" should contain "page2.html" and "page3.html".

Now open "page2.html" in your browser and try the links. You'll notice that the link to "page1.htm" no longer works, but "page3.html's" link still does. This is because "page3.html" is still in the same folder as "page2.html". The file "page1.html" is no longer in the same folder as "page2.html". None of the links on "page1.html" will work. Lets get them to.

Open "page1.html" in your editor. The links currently read like this:

<a href="page2.html">


<a href="page3.html">

We'll need to add the new folder's name that contains "page2.html" and "page3.html". All we do is add the folder's name and a slash ( / ):

<a href="folder1/page2.html>


<a href="folder1/page3.html>

Now try the new links and they'll work. They lead the browser down to "folder1" and then to the specific files: "page2.html" and "page3.html". This is how you go down a folder hierarchy (directory structure). You just keep listing the subfolders and separating the names with slashes until you reach the file you want.