How to Create a Hyperlink to Another File

Techwalla may earn compensation through affiliate links in this story.
Image Credit: Thinkstock Images/Comstock/Getty Images

Hyperlinks are references to either a location within the same document, or to a different, external document. These external documents may be elsewhere on the same computer or on a different computer entirely. This article looks at how to make an hyperlink to an external file on a web page using HTML and by using a word processor.

Advertisement

Organization

Step 1

Find the file. If the destination file is in the same directory tree as the file containing our link, we will be able to use a "relative" link. If the file is on another computer, we will need to write out that location using the Uniform Resource Identifier (URI) syntax common to web browsers.

Video of the Day

Step 2

Record the name and location of the file to you want linked in. In our examples, we will work with three files. File1.pdf will be located in the same directory as the file in which we're making the link. File2.pdf will be located in the /secondfile directory. File3.pdf will be on the web site null.org.

Advertisement

Step 3

Pick the text in your web page or document that you would like to use to represent the link. This text will be called the label for the link. In these examples the words "file1," "file2" and "file3" will be our labels.

Web Page Syntax

Step 1

Most web pages are written using HyperText Markup Language (HTML). To add a link to an HTML page, you identify the destination file first, and then list the word or words you want "linked" with that destination file.

Advertisement

Step 2

The HTML link syntax starts and ends with the Anchor element. The HyperText Reference (href) will indicate the name and location of the file, and the label for the link will be nested within greater and less-than signs.

Step 3

See how the href value can point to other machines as easily as it points to the working directory the file is currently in. file1 file2 file3

Step 4

Check your work against these examples: In my example file1 is in my current directory. In this example file2 is in a different directory on the same server. In this example file3 file3 is on the Internet server at null.org.

Advertisement

Using an Office Suite

Step 1

With popular word processing packages, the process is even easier. This example will use OpenOffice Writer as an example.

Step 2

Type out the text you want. Select the text you want to use as a label--whether by using the mouse or holding the shift key down as you move with the arrow keys.

Step 3

From the Insert menu, select "Hyperlink." A set of different icons appear on the left side of the Dialog box to help you add different types of hyperlinks. Select "Internet."

Advertisement

Step 4

In the Dialog box, add the path and file name at the top, and the label down below.

Step 5

Click "Apply" to make the change and "Close" to go back to composing your text.

Things You'll Need

  • Word Processor (Microsoft Word, OpenOffice, StarOffice, or similar) or

  • Text Editor

  • External file, such as banner.jpg

Advertisement

references