How to Hyperlink to a Folder

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.
Web pages are written in the HTML programming language.

Just like the files on your computer's hard drive, files on the Web are organized in a nested structure of folders. Web browsers are capable of displaying the contents of these folders, just like the Windows Explorer you use to browse the contents of your hard drive. Hyperlinks, the connections you use to jump between different Web pages, can link to folders as well as to specific files.

Advertisement

Step 1

Copy the location of the folder. If you are linking to a local folder, the format of the folder's address will depend on your OS. In Windows, for example, a folder path may be "C:\Users\Lincoln." Folder structures on Web servers are in a URL format, such as "http://www.presidents.org/old/lincoln/".

Advertisement

Video of the Day

Step 2

Open an tag in the HTML code for the page to which you want to add a hyperlink. Use "Link text" (without quotes) for your hyperlink code. For Windows, use "Lincoln in Windows". For a Web folder, use "Lincoln online".

Step 3

Use relative paths to shorten the address in a hyperlink, or to ensure that you can move your files and folders to another server without rewriting the hyperlinks. If the file containing the hyperlink is located in the "www.presidents.org/old/" directory, for example, a link to "www.presidents.org/old/lincoln/" can simply read: "Relative link to Lincoln." The "." in the link address represents the current working folder, the folder the HTML file is in, standing in for the longer "http://www.presidents.org/old/". If the HTML file and the "lincoln" directory are moved to a different place, such as "http://www.famousamericans.net/19thcentury/", the "./lincoln/" address will still point to the right place, while a more specific address would have to be rewritten.

Advertisement

Video of the Day

Advertisement

Advertisement

Report an Issue

screenshot of the current page

Screenshot loading...