About hyperlinks

Some of the content in this topic may not be applicable to some languages.

A hyperlink is a link from a document that, when clicked, opens another page or file. The destination is frequently another Web page, but it can also be a picture, or an e-mail address, or a program. The hyperlink itself can be text or a picture.

When a site visitor clicks the hyperlink, the destination is shown in a Web browser, opened, or run, depending on the type of destination. For example, a hyperlink to a page shows the page in the Web browser, and a hyperlink to an AVI file opens the file in a media player.

How hyperlinks are used

You can use hyperlinks to do the following:

When you point to text or a picture that contains a hyperlink, the pointer becomes a hand Pointer in the shape of a hand, indicating that it is something you can click.

What a URL is and how it works

When you create a hyperlink, its destination is encoded as a Uniform Resource Locator (URL), such as http://example.microsoft.com/news.htm or file://ComputerName/SharedFolder/FileName.htm. The following illustration defines the parts of the URL:

The parts of a Uniform Resource Locator (URL) 

1  Protocol

2  Web server or network location

3  Path

4  File name

What is the difference between an absolute and a relative hyperlink?

An absolute URL contains a full address, including the protocol, the Web server, the path and the file name.

 A relative URL has one or more missing parts. The missing information is taken from the page that contains the URL. For example, if the protocol and Web server are missing, the Web browser uses the protocol and domain, such as .com, .org, .edu, of the current page.

It is common for pages in a web to use relative URLs containing only a partial path and file name. If the files are moved to another server, any hyperlinks will continue to work as long as the relative positions of the pages remains unchanged. For example, a hyperlink on Products.htm points to a page named apple.htm in a folder named Food; if both pages are moved to a folder named Food on a different server, the URL in the hyperlink will still be correct. 

Using text versus pictures

A text hyperlink is a word or phrase that has been assigned a destination URL.

A picture hyperlink is a picture that has been assigned a destination URL in one of two ways: 

How hyperlinks are shown

Hyperlinks can be indicated in various ways. Web browsers usually underline text hyperlinks and display them in different colors. For example, this is how a text hyperlink might look before you click it.

Unclicked hyperlinks are often, but not always, blue and underlined.

This is how a text hyperlink might look after you click it.

When a text hyperlink is clicked, it usually changes color. 

Hyperlinks on a picture are not always visible, but a site visitor can tell that a picture has a hyperlink by positioning the mouse pointer over it — the mouse pointer changes appearance, usually to a pointing hand Pointer in the shape of a hand. Position your mouse pointer over the following button:

The mouse pointer changes to indicate a hyperlink  


To emphasize a hyperlink even more, you can also add Dynamic HTML effects or animation to hyperlinks. 

An animated GIF


A hyperlink should also give a visual cue about where it leads; for example, the hyperlinks below could be used to lead to a web's home page:

Home Page

Hyperlink to a home page

Managing hyperlinks

Renaming and moving files in your web

Whenever you rename a file in your Web site Office checks to see whether there are any hyperlinks to the file. If there are, Office will update the hyperlinks with the new file name. Whenever you move a file in your web (for example, to a subfolder), Office automatically updates any hyperlinks to that file with its new location.

Testing and repairing broken hyperlinks

Before you publish a Web site, you should always check for broken hyperlinks and test hyperlinks to external destinations. A broken hyperlink is one that has an invalid destination URL — when the hyperlink is clicked, the Web browser displays an error to the site visitor. The cause might be as simple as a URL that was mistyped, or one that points to a page that you deleted from your web. If the destination is another page on the World Wide Web, the page might have been moved or deleted.